-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
AttributeError: module 'pandas' has no attribute 'tslib' #27385
Comments
|
From the traceback it looks like this is an issue with ggplot and it has already been brought up on their tracker: It doesn't really look like that package is maintained though so I think we should repurpose this issue to remove any reference to |
Ignore previous comment - shouldn't need to change docs as ggplot is a built in style for matplotlib. @syouhung1904 your issue seems to stem from that third party library so nothing to be done on the pandas side here. |
it thrown the same error in bokeh https://stackoverflow.com/questions/45972782/plot-time-series-graph-using-bokeh |
Problem description
I just installed ggplot on my Windows x64 running Python 3.5 using pip. When I try to run:
from ggplot import *
from sklearn.metrics import roc_curve, auc
preds = log_mod.predict_proba(X_test)[:,1]
fpr, tpr, _ = roc_curve(y_test, preds)
df_dummies = pd.DataFrame(dict(fpr=fpr, tpr=tpr))
ggplot(df_dummies, aes(x='fpr', y='tpr')) +
geom_line() +
geom_abline(linetype='dashed')
I got the error: AttributeError: module 'pandas' has no attribute 'tslib'
Here is the traceback:
AttributeError Traceback (most recent call last)
in
----> 1 from ggplot import *
2 from sklearn.metrics import roc_curve, auc
3
4
5 preds = log_mod.predict_proba(X_test)[:,1]
~\Anaconda3\lib\site-packages\ggplot_init_.py in
17
18
---> 19 from .geoms import geom_area, geom_blank, geom_boxplot, geom_line, geom_point, geom_jitter, geom_histogram, geom_density, geom_hline, geom_vline, geom_bar, geom_abline, geom_tile, geom_rect, geom_bin2d, geom_step, geom_text, geom_path, geom_ribbon, geom_now_its_art, geom_violin, geom_errorbar, geom_polygon
20 from .stats import stat_smooth, stat_density
21
~\Anaconda3\lib\site-packages\ggplot\geoms_init_.py in
----> 1 from .geom_abline import geom_abline
2 from .geom_area import geom_area
3 from .geom_bar import geom_bar
4 from .geom_bin2d import geom_bin2d
5 from .geom_blank import geom_blank
~\Anaconda3\lib\site-packages\ggplot\geoms\geom_abline.py in
----> 1 from .geom import geom
2
3 class geom_abline(geom):
4 """
5 Line specified by slope and intercept
~\Anaconda3\lib\site-packages\ggplot\geoms\geom.py in
1 from future import (absolute_import, division, print_function,
2 unicode_literals)
----> 3 from ..ggplot import ggplot
4 from ..aes import aes
5
~\Anaconda3\lib\site-packages\ggplot\ggplot.py in
11 import warnings
12
---> 13 from .aes import aes
14 from .legend import make_legend
15 from .themes import theme_gray
~\Anaconda3\lib\site-packages\ggplot\aes.py in
9 from patsy.eval import EvalEnvironment
10
---> 11 from . import utils
12
13 import numpy as np
~\Anaconda3\lib\site-packages\ggplot\utils.py in
79
80 date_types = (
---> 81 pd.tslib.Timestamp,
82 pd.DatetimeIndex,
83 pd.Period,
AttributeError: module 'pandas' has no attribute 'tslib'
I have tried to :
change
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
)
Then do the same in the ggplot/stats/smoothers.py file
AND
comment out
from pandas.lib import Timestamp
But It didn't work.
Expected Output
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]The text was updated successfully, but these errors were encountered: