Last active
June 23, 2020 12:22
-
-
Save shinokada/720f2af25ef559aa5ea697a230ed47ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cols = [2,10,14] | |
rows = [33,36,39,42,45,48,51,57] | |
df =df.iloc[rows,cols].reset_index(drop=True) | |
df.columns=['race','Male','Female'] | |
for col in ['Male', 'Female']: | |
df[col]=pd.to_numeric(df[col].str.replace('%','')) | |
display(df) | |
print(df.dtypes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment