Pandas - 1회차(정리)
✔️ import pandas as pd ✔️ DataFrame 만들기1) dictdf = pd.DataFrame( { "a" : [ 1,2,3 ] , "b" : [ 4,5,6 ] , "c" : [ 7,8,9 ] } , 딕셔너리 기호 닫고 쉼표 index = [ 1, 2, 3 ] ) 2) listdf = pd.DataFrame( [ [ 1,2,3 ] , [ 4,5,6 ] , [ 7,8,9 ] , index = [ 1, 2, 3 ] , columns = [ 'a', 'b', 'c' ] ) columns 추가해야 ✔️ DataFrame 만들기1) loc 여기서 3은 la..
2025. 7. 4.
데이터 분석 및 시각화 - Pandas
00. Pandasimport pandas as pd01. Series1. Series 객체 생성temp = pd.Series ( [ -20, -10, 10, 20 ] )temp[0] , temp[2]2. Series 객체 생성 ( Index 지정 )temp = pd.Series ( [ -20, -10, 10, 20 ] , index = [ 'Jan', 'Feb', 'Mar', 'Apr' ]temp[ 'Jan' ], temp[ 'Apr' ]02. DataFramedata = { 'KEY' : [ 데이터1, 데이터2, 데이터3, ...] } - 딕셔너리1. DataFrame 객체 생성df = pd.DataFrame ( data )2. DataFrame 데이터 접근df [ '이름' ], df [ '키'..
2025. 6. 24.