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

Chapter 2 - deprecated import of pandas module #40

Closed
martynoconnor opened this issue Jun 17, 2017 · 2 comments
Closed

Chapter 2 - deprecated import of pandas module #40

martynoconnor opened this issue Jun 17, 2017 · 2 comments

Comments

@martynoconnor
Copy link

In chapter two, the cell which imports the scatter matrix from pandas uses deprecated call to do so:

`from pandas.tools.plotting import scatter_matrix

attributes = ["median_house_value", "median_income", "total_rooms",
"housing_median_age"]
scatter_matrix(housing[attributes], figsize=(12, 8))
save_fig("scatter_matrix_plot")`

This returns the warning:

/home/martyn/anaconda2/lib/python2.7/site-packages/ipykernel/__main__.py:5: FutureWarning: 'pandas.tools.plotting.scatter_matrix' is deprecated, import 'pandas.plotting.scatter_matrix' instead.

It is remedied by simply deleting the tools. in after the "from pandas"

@ageron
Copy link
Owner

ageron commented Jun 19, 2017

Hi @martynoconnor, thanks for your feedback.

You are right that the import path is deprecated, but only in Pandas 0.20. The notebooks are based on Pandas 0.19 (see requirements.txt). However, I'm currently thinking about upgrading the libraries, in particular to upgrade to TensorFlow 1.2. When I do that I'll make sure to fix the import path, thanks for the heads up!

Cheers,
Aurélien

@ageron ageron closed this as completed Jun 19, 2017
@salutatio
Copy link

salutatio commented Jan 28, 2018

With Pandas 0.22, you can use this :

from pandas.plotting import scatter_matrix
attributes = ["median_house_value", "median_income", "total_rooms",
"housing_median_age"]
scatter_matrix(housing[attributes], figsize=(12, 8))

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

No branches or pull requests

3 participants