pandas 특정 행,열 제거
#id 컬럼 제거 df.drop('id',axis=1, inplace=True) # axis=0 로우
- Code Cloud/python
- · 2022. 1. 20.
전처리 함수 정의
# 전처리 함수 정의 def preprocessor(text): text = re.sub('[^가-힣\s]+','',text) # 한글, 공백문자 남기고 다 날리기 return text
- Code Cloud/python
- · 2022. 1. 20.
리스트 비교 후 서로 다른 항목만 가져오기
allshort_list = [] for i in short_list : if i not in collapsed_list : allshort_list.append(i)
- Code Cloud/python
- · 2022. 1. 8.