Python
phrase input should be string, not <class 'float'>
ndlessrain
2024. 1. 7. 11:39
728x90
df['file'] = df['art_nm'].str.replace("[^ㄱ-ㅎㅏ-ㅣ가-힣 ]","")
for sentence in tqdm(df[' art_nm ']):
# print(sentence)
tokenized_sentence = okt.morphs(sentence, stem=True) # 토큰화
도중에 float이 들어있다고 한다.
np.nan 데이터가 float으로 인식되는듯.
df["art_nm"] = df["art_nm"].replace("", " ")
df["art_nm"] = df["art_nm"].replace(np.nan, " ")
위와 같이 처리 후 진행.
728x90