Python
-
pandas basic 02데이터분석 2019. 10. 10. 20:08
01. Column Selection there are a few ways to select columns in a DataFrame. # select by indexing mydf[[col1, col2, col3]] # select by dtype mydf.select_dtypes(include=['int']) # select by filter mydf.filter(like='flag') mydf.filter(regex='\d') mydf.filter(like='pre_') # ex1) select columns having NaN null_cols = (mydf.select_dtypes(['object']).isnull().sum..
-
pandas basic 01데이터분석 2019. 10. 10. 20:04
1. pandas basic elements index = myData.index columns = myData.columns data = myData.values 2. Data types # check all data types myData.dtypes # counts them myData.get_dtype_counts() 3. Handling a Series Select a column # choose one myData['column_name'] myData.column_name if you want to treat it as a dataframe, mySeries.to_frame() check frequencies # total mySeries.size mySeries.shape l..