-
Notifications
You must be signed in to change notification settings - Fork 2
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
Valeu Error for In [10] #8
Comments
That's strange - did you parse the data again or did you use the provided data? It's possible that wikipedia changed their page layout and some modifications are needed. Did you run all cells in the same order (top to bottom)? The line it is erroring out on is supposed to delete the footnotes ( Because your error string ( |
I did parse the data. I will look at it again. |
Ok hope it works out! And happy experimenting with Python. |
I received a Value Error when attempting to run the code. Any Suggestions?
ValueError Traceback (most recent call last)
in
3 Census[key] = Census[key][['State','Population']]
4 Census[key].loc[:,'Population']=Census[key].loc[:,'Population'].apply(
----> 5 lambda s: int(re.sub(r'[.*','', str(s)).replace(',','')))
6 display(Census[key].head(8))
~\Anaconda3\lib\site-packages\pandas\core\series.py in apply(self, func, convert_dtype, args, **kwds)
3846 else:
3847 values = self.astype(object).values
-> 3848 mapped = lib.map_infer(values, f, convert=convert_dtype)
3849
3850 if len(mapped) and isinstance(mapped[0], Series):
pandas_libs\lib.pyx in pandas._libs.lib.map_infer()
in (s)
3 Census[key] = Census[key][['State','Population']]
4 Census[key].loc[:,'Population']=Census[key].loc[:,'Population'].apply(
----> 5 lambda s: int(re.sub(r'[.*','', str(s)).replace(',','')))
6 display(Census[key].head(8))
ValueError: invalid literal for int() with base 10: '101130]'
The text was updated successfully, but these errors were encountered: