Python

Python/Pandas

[Pandas] 데이터 살펴보기 / head,tail,info,describe,shape,count,value_counts

데이터 살펴보기¶ head(n) : 처음 n개의 행을 보여줌 / tail(n) : 마지막 n개의 행을 보여줌¶ In [1]: import pandas as pd df = pd.read_csv('C:\\Users\\rladl\\Jupyter.study\\05000266\\part3\\auto-mpg.csv', header=None) df.columns = ['mpg','cylinders','displacement','horsepower','weight','acceleration','model year','origin','name'] print(df.head()) print('\n') print(df.tail()) mpg cylinders displacement horsepower weight acceler..

Python/Pandas

[Pandas] series / dataframe / 데이터구조 다루기

Series¶ 시리즈 만들기 (딕셔너리, 리스트)¶ In [2]: # 판다스 불러오기 import pandas as pd # key:value 쌍으로 딕셔너리 만들고, 변수 dict_data에 저장 dict_data = {'a':1,'b':2,'c':3} # series()함수로 dictionary를 series로 변환 sr = pd.Series(dict_data) print(type(sr)) print('\n') print(sr) a 1 b 2 c 3 dtype: int64 In [4]: list_data = ['2019-01-02', 3.14,'abc',100,True] sr = pd.Series(list_data) print(sr) 0 2019-01-02 1 3.14 2 abc 3 100 4 Tru..

kylo
'Python' 카테고리의 글 목록 (5 Page)