6
데이터 프레임의 모든 문자열 제거 / 자르기
python / pandas에서 다중 유형 데이터 프레임의 값을 정리하고 문자열을 자르고 싶습니다. 현재 두 가지 지침으로 수행하고 있습니다. import pandas as pd df = pd.DataFrame([[' a ', 10], [' c ', 5]]) df.replace('^\s+', '', regex=True, inplace=True) #front df.replace('\s+$', '', regex=True, inplace=True) #end df.values 이것은 매우 느립니다. 무엇을 개선 할 수 …