분류 전체보기(50)
-
Pandas 데이터분석 기초 실습-6
열 정보로 데이터 그룹생성하기¶group by¶ In [1]: import pandas as pd In [2]: student_list = [ {'name':'John','major':'computer science','sex':'male'}, {'name':'Nate','major':'computer science','sex':'male'}, {'name':'Abraham','major':'Physics','sex':'male'}, {'nam..
2021.09.22 -
Pandas 데이터분석 기초 실습 -5
행,열(로우, 칼럼) 생성 및 수정하기¶ In [3]: import pandas as pd In [4]: friend_dict_list = [ {'name':'Jone','age':15,'job':'student'}, {'name':'Jenny','age':30,'job':'developer'}, {'name':'Nate','age':30,'job':'teacher'} ] column = [ 'name','age','job' ] df = pd.Data..
2021.09.22 -
Pandas 데이터분석 기초 실습 -4
데이터 프레임 행, 열 삭제하기¶ In [11]: import pandas as pd friends =[ {'age':15,'job':'student'}, {'age':20,'job':'developer'}, {'age':30,'job':'teacher'} ] index = ['John','Jenny','Nate'] column = ['age','job'] df = pd.DataFrame(friends, index= index, columns=column ) df Out[11]: age job John 15..
2021.09.22 -
Pandas 데이터분석 기초실습 -3
데이터 프레임 파일로 저장하기¶ In [1]: import pandas as pd In [3]: friends = [ {'name':'Jone','age':20,'job':'student'}, {'name':'Jenny','age':30,'job':None}, {'name':'Nate','age':30,'job':'teacher'} ] df = pd.DataFrame(friends) df = df[['name','age','job']] df.head() Out[3]..
2021.09.22 -
Pandas 데이터분석 기초 실습 -2
In [1]: import pandas as pd In [6]: friend_dict_list = [ {'name':'John','age':25,'job':'student'}, {'name':'Nate','age':30,'job':'teacher'} ] df = pd.DataFrame(friend_dict_list) df.head() #딕셔너리의 경우 key 값의 순서가 보장되지 않는다 Out[6]: name age job 0 John 25 student 1 Nate 30 teacher In [8]: df = df[['name','age..
2021.09.22 -
Pandas 데이터 분석 기초 실습-1
In [2]: import pandas as pd In [12]: data_frame = pd.read_csv('data/friend_list.csv') data_frame Out[12]: name age job 0 John 20 student 1 Jenny 30 developer 2 Nate 30 teacher 3 Julia 40 dentist 4 Brian 45 manager 5 Chris 25 intern 6 BoBo 6 Dog 7 Sol 1 Dog In [15]: data_frame.head(2) #앞에 두개 Out[15]: name age job 0 John 20 student 1 Jenny 30 developer In [17]: data_frame.tail(2) #뒤에 두개 ,c..
2021.09.22