- Read the college dataset with the institution name as the index:
>>> college = pd.read_csv('data/college.csv', index_col='INSTNM')>>> college.dtypesCITY object STABBR object HBCU float64 MENONLY float64 ... PCTFLOAN float64 UG25ABV float64 MD_EARN_WNE_P10 object GRAD_DEBT_MDN_SUPP object Length: 26, dtype: object
- All the other columns besides CITY and STABBR appear to be numeric. Examining the data types from the preceding step reveals unexpectedly that the MD_EARN_WNE_P10 and GRAD_DEBT_MDN_SUPP columns are of type object and not numeric. To help get a better idea of what kind of values are in these columns, let's examine their first value:
>>> college.MD_EARN_WNE_P10.iloc[0]'30300'>>> college.GRAD_DEBT_MDN_SUPP.iloc[0] ...