Skip to content
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

pandas.lib module is deprecated and will be removed in a future version. #618

Open
Make42 opened this issue Aug 14, 2017 · 12 comments
Open

Comments

@Make42
Copy link

Make42 commented Aug 14, 2017

For ggplot 0.11.5 (in anaconda for python 3.6.2) I get the warning

[...]/lib/python3.6/site-packages/ggplot/stats/smoothers.py:4: FutureWarning: The pandas.lib module is deprecated and will be removed in a future version. These are private functions and can be accessed from pandas._libs.lib instead from pandas.lib import Timestamp

@RanChenSignIn
Copy link

you have solve the problem?,i also meet the warning ,

@k4rt33k
Copy link

k4rt33k commented Aug 30, 2017

Can you also provide the code that results in this warning? Otherwise it is hard to know if the issue has been fixed. The issue is because of the line from pd.lib import Timestamp, which is deprecated in the latest version of pandas. You can remove the error by replacing all uses of Timestamp in the file to pd.Timestamp.

It will also help if your provided more details about your environment such as version of pandas in order to reliably fix the problem.

@aalloul
Copy link

aalloul commented Dec 28, 2017

Hi, I'd like to up vote this issue.

My current setup:
python 3.6.1
pandas: '0.21.1'
ggplot: '0.11.5'

I'm working on OSX 10.12.6

To reproduce the issue, it's as easy as
import ggplot

The issue itself is the following warning

You can access Timestamp as pandas.Timestamp
  pd.tslib.Timestamp,
/anaconda/envs/tnt/lib/python3.6/site-packages/ggplot/stats/smoothers.py:4: FutureWarning: The pandas.lib module is deprecated and will be removed in a future version. These are private functions and can be accessed from pandas._libs.lib instead
  from pandas.lib import Timestamp```

I hope this helps!

@Make42
Copy link
Author

Make42 commented Feb 6, 2018

I am using https://github.com/has2k1/plotnine by now, which is actually maintained.

@liuxsdev
Copy link

I update pandas to 0.23.0 and can not import ggplot because these problem. In pandas 0.23.0 Timestamp can import like "from pandas import Timestamp" . does ggplot not update any more?

@laramume
Copy link

I am using ggplot 0.11.5 and am facing the issue where its not able to import timestamp from pandas library since I am using the latest version of pandas. Is this a bug or am I doing something wrong

ImportError Traceback (most recent call last)
in ()
8 import matplotlib.pyplot as plt
9 from pyspark.storagelevel import StorageLevel
---> 10 from ggplot import *
11
12 matplotlib.style.use('ggplot')

/anaconda/envs/py35/lib/python3.5/site-packages/ggplot/init.py in ()
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
22 from .facets import facet_wrap, facet_grid, Facet

/anaconda/envs/py35/lib/python3.5/site-packages/ggplot/stats/init.py in ()
1 from .stat_density import stat_density
----> 2 from .stat_smooth import stat_smooth

/anaconda/envs/py35/lib/python3.5/site-packages/ggplot/stats/stat_smooth.py in ()
3
4 from ..geoms.geom import geom
----> 5 from . import smoothers
6 from ..utils import is_date
7

/anaconda/envs/py35/lib/python3.5/site-packages/ggplot/stats/smoothers.py in ()
2 unicode_literals)
3 import numpy as np
----> 4 from pandas.lib import Timestamp
5 import pandas as pd
6 import statsmodels.api as sm

ImportError: cannot import name 'Timestamp'

@scaresnake
Copy link

scaresnake commented May 25, 2018

In smoothers.py changing

from pandas.libs import Timestamp

to

from pandas._libs.tslibs.timestamps import Timestamp

resolved the issue for me.

@jchiewch
Copy link

@scaresnake's solution works for me. (I'm using ggplot version 0.11.5 and pandas version 0.23.0)

datashinobi added a commit to datashinobi/MachineLearningSamples-PredictiveMaintenance that referenced this issue Jun 7, 2018
Fixes ggplot import failure due to breaking changes starting .22 in move of Timestamp from pandas pandas.libs  to pandas._libs.lib

yhat/ggpy#618
https://pandas.pydata.org/pandas-docs/version/0.22.0/whatsnew.htmltimes
@bashtage
Copy link

bashtage commented Jan 13, 2020

Oops, wrong project.

@jbrockmendel
Copy link

from pandas._libs.tslibs.timestamps import Timestamp

Please use from pandas import Timestamp, since pandas._libs is specifically non-public.

@bashtage
Copy link

@jbrockmendel @jreback Sorry for the spam. Somehow searched in the wrong place.

@anirudhrani
Copy link

anirudhrani commented Feb 20, 2021

Go to
C:\Users\windows\anaconda3\Lib\site-packages\ggplot\stats\smoothers.py

Then, change

from pandas.lib import Timestamp
to
from pandas import Timestamp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests