[Python] 10. pandas DataFrame 속성 : ndim, shape, len(), size, T, index, keys(), columns, values, dtypes, info() 예제
import pandas as pd import numpy as np data = {'eng':[10,30,50,70], 'kor':[20,40,60,80], 'math':[90,50,20,70]} df = pd.DataFrame(data, index=['a','b','c','d'] ) df df.ndim #몇차원 [OUT] : 2 df.shape #(행, 열) [OUT] : (4, 3) df.shape[0] #행의 갯수 [OUT] : 4 len(df) #행의 갯수 [OUT] : 4 df.size #데이터의 갯수 [OUT] : 4 df.T df.index [OUT] : Index(['a', 'b', 'c', 'd'], dtype='object') df.keys() [OUT] : Index(['eng', ..