Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Exercise 20b — Beyond 2 #9

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arindamchoudhury
Copy link

df.info()

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 1000 entries, 0 to 999
Data columns (total 7 columns):
 #   Column                    Non-Null Count  Dtype  
---  ------                    --------------  -----  
 0   city                      1000 non-null   object 
 1   growth_from_2000_to_2013  1000 non-null   object 
 2   latitude                  1000 non-null   float64
 3   longitude                 1000 non-null   float64
 4   population                1000 non-null   int64  
 5   rank                      1000 non-null   int64  
 6   state                     1000 non-null   object 
dtypes: float64(2), int64(2), object(3)
memory usage: 54.8+ KB

pd.cut fails as column growth_from_2000_to_2013 is string

# Turn to float
df['growth_from_2000_to_2013'] = df['growth_from_2000_to_2013'].astype(float)

fixes this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant