import pandas as pd
lst_A = ['banana 3','apple 5','orange 6','mango 7']
df = pd.DataFrame(lst_A, columns=['text'])
df
df['fruit'] = df.text.str.split(' ').str[0]
df['count'] = df.text.str.split(' ').str[1]
df
'Python > Python For Analytics' 카테고리의 다른 글
[Python] matplotlib - pie graph (0) | 2020.07.09 |
---|---|
[Python] matplotlib - angle line graph (0) | 2020.07.08 |
[Python] pandas 중복값 처리 (duplicates, drop_duplicates) (0) | 2020.04.08 |
[Python] Pandas iis-log DataFrame 접속자IP 국가식별 컬럼 추가 (0) | 2020.02.28 |
[Python] replacement of Pandas dataframe NaN value (0) | 2020.02.16 |
[Python] padnas dataframe URL Decode (2) | 2020.02.16 |
[Python] numpy.where 를 이용하여 컬럼을 다양한 데이터 타입과 비교 (0) | 2020.01.21 |
[Python] pandas dataframe 리스트로 변환 (0) | 2019.10.30 |