I am unable to use ggplot
package in python .
import pandas as pd
from ggplot import *
import pandas as pd
from ggplot import *
It returns:
AttributeError: module 'pandas' has no attribute 'tslib'
I changed import
commands for pandas
modules in ggplot
source files on my PC and it worked for me. You can find the locations for those on your PC in your error message. For me it was C:\Users\user\Anaconda3\Lib\site-packages\ggplot
The files I have changed:
In C:\Users\user\Anaconda3\Lib\site-packages\ggplot\utils.py
From
date_types = (
pd.tslib.Timestamp,
pd.DatetimeIndex,
pd.Period,
pd.PeriodIndex,
datetime.datetime,
datetime.time
)
to:
date_types = (
pd._tslib.Timestamp,
pd.DatetimeIndex,
pd.Period,
pd.PeriodIndex,
datetime.datetime,
datetime.time
)
And in C:\Users\user\Anaconda3\Lib\site-packages\ggplot\stats\smoothers.py
the same change as above and in addition:
from pandas.lib import Timestamp
to:
from pandas import Timestamp
date_types = (
pd.tslib.Timestamp,
pd.DatetimeIndex,
pd.Period,
pd.PeriodIndex,
datetime.datetime,
datetime.time
)
to:
date_types = (
pd.Timestamp,
pd.DatetimeIndex,
pd.Period,
pd.PeriodIndex,
datetime.datetime,
datetime.time
)
I found this problem in colab. To solve this problem simply click the link to util.py,smoother.py in error notification.
then ctrl-s to save new configuration
then ctrl-s to save new configuration after fix all above. Run this cell again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With