Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pandas Dataframe has no Plot function

I'm trying to call df.plot.scatter(...) as shown here, where df is a pandas.Dataframe object.

But my IDE can't suggest any plot function when I initiate suggestions (though it can suggest other dataframe members like fillna(), to_json() etc).

If I anyway write df.plot.scatter(...) and run it, it gives error:

AttributeError: 'function' object has no attribute 'scatter'

I use python 3.4 on windows 7. My IDE is PyCharm. These are the imports:

import pandas as pd
import matplotlib.pyplot as plt

Can it be about my python version, or maybe this function is removed from pandas API? Thanks in advance.

like image 833
hansolo Avatar asked Apr 10 '26 08:04

hansolo


1 Answers

I think your pandas version is older as 0.17.0.

See DataFrame.plot.scatter:

New in version 0.17.0.

In older version you can use:

df.plot(kind='scatter')
like image 157
jezrael Avatar answered Apr 13 '26 11:04

jezrael



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!