I have ggplot successfully installed in my python 3.6.3 using the code below:
conda install -c conda-forge ggplot
But when I import it in my notebook using the code below, I get an error:
from ggplot import *
ImportError: cannot import name 'Timestamp'
I would appreciate any idea on how I can solve this problem.
I have encountered the same problem.
Please go to .../site-packages/ggplot/stats/smoothers.py and change
from pandas.lib import Timestamp
to
from pandas import Timestamp
and save.
@Liaoming999 is correct but adding more changes to resolve this problem:
../site-packages/ggplot/stats/smoothers.py
from pandas.lib import Timestamp
to from pandas import Timestamp
in line 4pd.tslib.Timestamp
to pd.Timestamp
in line 14.../site-packages/ggplot/utils.py
and goto line 81 and do the same as step 3. Thanks to @wmsmith for this tip.p.s.: General advise is to use Anaconda or some Virtual env.
I encountered the same problem after upgrading to pandas 0.23 on a databricks server.
Had to come up with this command-line solution using the unix sed
tool:
cd .../python/lib/python3.5/site-packages/ggplot/stats/
sed -i 's/pandas.lib/pandas/g' smoothers.py
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