We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Posting an issue I received through email:
in Chapter 3, notebook "02-Decomposing Time Series.ipynb", I get an error in the line:
tesla_revenue = pd.read_html("https://en.wikipedia.org/wiki/Tesla,_Inc.")[4][['Year', "Revenue(mil. USD)"]]
Error:
KeyError: "None of [Index(['Year', 'Revenue(mil. USD)'], dtype='object')] are in the [columns]"
In this loaded file there are no columns „Year“ and „Revenue“.
The text was updated successfully, but these errors were encountered:
Wikipedia has since been updated and now there are more tables and hence the code is breaking.
Two solutions:
tesla_revenue = pd.read_html("https://en.wikipedia.org/wiki/Tesla,_Inc.")[5][['Year', "Revenue(mil. USD)"]]
But this is brittle and may break in the future.
Instead, we can fix the wiki link to an archived one
tesla_revenue = pd.read_html("https://en.wikipedia.org/w/index.php?title=Tesla,_Inc.&oldid=1111822107")[4]
Sorry, something went wrong.
tesla_revenue = pd.read_html("https://en.wikipedia.org/wiki/Tesla,_Inc.")[8][['Year', "Revenue(mil. USD)"]], now
No branches or pull requests
Posting an issue I received through email:
Error:
In this loaded file there are no columns „Year“ and „Revenue“.
The text was updated successfully, but these errors were encountered: