amueller / introduction_to_ml_with_python

Notebooks and code for the book "Introduction to Machine Learning with Python"
7.45k stars 4.57k forks source link

Wrong returned object in mglearn.datasets.load_citibike() #20

Closed CristhianBoujon closed 7 years ago

CristhianBoujon commented 7 years ago

When I run

citibike = mglearn.datasets.load_citibike()
print("Citibike data:\n{}".format(citibike.head()))

I have the exception:


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-eb013c64f388> in <module>()
----> 1 print("Citibike data:\n{}".format(citibike.head()))

AttributeError: 'numpy.float64' object has no attribute 'head'

I guess that the returned object should be a pandas.DataFrame

amueller commented 7 years ago

Yeah it should be (or maybe a series?). It is a single float instead? What version of pandas do you have installed? Also, how did you download mglearn?

CristhianBoujon commented 7 years ago

I have upgrade pandas from 0.17.1 to 0.19.2 and works great now! Thanks!