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

Plotting time series returns ImportError: cannot import name 'checked_add_with_arr' #16327

Closed
natashawatkins opened this issue May 11, 2017 · 6 comments

Comments

@natashawatkins
Copy link


ImportError Traceback (most recent call last)
in ()
4 #data.loc[ind,"Quantity"].loc[:,"Total"].plot()
5 #data.loc[ind,"Quantity"].dropna(how = "all").plot('variable')
----> 6 data['Price'].plot()

/Users/user/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in call(self, kind, ax, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, label, secondary_y, **kwds)

/Users/user/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in plot_series(data, kind, ax, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, label, secondary_y, **kwds)

/Users/user/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in _plot(data, x, y, subplots, ax, kind, **kwds)

/Users/user/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in generate(self)

/Users/user/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in _make_plot(self)

/Users/user/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in _is_ts_plot(self)

/Users/user/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in _use_dynamic_x(self)

/Users/user/anaconda/lib/python3.5/site-packages/pandas/tseries/plotting.py in ()
1 # flake8: noqa
2
----> 3 from pandas.plotting._timeseries import tsplot

/Users/user/anaconda/lib/python3.5/site-packages/pandas/plotting/init.py in ()
15 parallel_coordinates, lag_plot,
16 autocorrelation_plot)
---> 17 from pandas.plotting._core import boxplot
18 from pandas.plotting._style import plot_params
19 from pandas.plotting._tools import table

/Users/user/anaconda/lib/python3.5/site-packages/pandas/plotting/_core.py in ()
22 from pandas.core.index import Index, MultiIndex
23 from pandas.core.series import Series, remove_na
---> 24 from pandas.core.indexes.period import PeriodIndex
25 from pandas.compat import range, lrange, map, zip, string_types
26 import pandas.compat as compat

/Users/user/anaconda/lib/python3.5/site-packages/pandas/core/indexes/period.py in ()
25 import pandas.tseries.frequencies as frequencies
26 from pandas.tseries.frequencies import get_freq_code as _gfc
---> 27 from pandas.core.indexes.datetimes import DatetimeIndex, Int64Index, Index
28 from pandas.core.indexes.timedeltas import TimedeltaIndex
29 from pandas.core.indexes.datetimelike import DatelikeOps, DatetimeIndexOpsMixin

/Users/user/anaconda/lib/python3.5/site-packages/pandas/core/indexes/datetimes.py in ()
36 to_offset, get_period_alias,
37 Resolution)
---> 38 from pandas.core.indexes.datetimelike import (
39 DatelikeOps, TimelikeOps, DatetimeIndexOpsMixin)
40 from pandas.tseries.offsets import DateOffset, generate_range, Tick, CDay

/Users/user/anaconda/lib/python3.5/site-packages/pandas/core/indexes/datetimelike.py in ()
20 from pandas.core.dtypes.missing import isnull
21 from pandas.core import common as com, algorithms
---> 22 from pandas.core.algorithms import checked_add_with_arr
23 from pandas.core.common import AbstractMethodError
24

ImportError: cannot import name 'checked_add_with_arr'

This was working before the update? Not sure what is happening.

@TomAugspurger
Copy link
Contributor

Can you post a copy-pastable example? Your code isn't runnable since data isn't defined.

@TomAugspurger
Copy link
Contributor

Also post your version info.

@natashawatkins
Copy link
Author

@TomAugspurger I just upgraded to pandas v0.2 - Python 3.5.3 |Anaconda custom (x86_64)

Here's an example..

df = pd.DataFrame({'a': {('1877-09-30 00:00:00'): np.nan, ('1877-10-31 00:00:00'): np.nan}, 'b': {('1877-09-30 00:00:00'): 10000000, ('1877-10-31 00:00:00'): 55000000}, 'c': {('1877-09-30 00:00:00'): 10000000.0, ('1877-10-31 00:00:00'): 55000000.0}, 'd': {('1877-09-30 00:00:00'): 9114500, ('1877-10-31 00:00:00'): 44250000}, 'e': {('1877-09-30 00:00:00'): 885500, ('1877-10-31 00:00:00'): 10750000}})

df['c'].plot()

throws this error...

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-119-1454b0324298> in <module>()
     10 df = pd.DataFrame({'a': {('1877-09-30 00:00:00'): np.nan, ('1877-10-31 00:00:00'): np.nan}, 'b': {('1877-09-30 00:00:00'): 10000000, ('1877-10-31 00:00:00'): 55000000}, 'c': {('1877-09-30 00:00:00'): 10000000.0, ('1877-10-31 00:00:00'): 55000000.0}, 'd': {('1877-09-30 00:00:00'): 9114500, ('1877-10-31 00:00:00'): 44250000}, 'e': {('1877-09-30 00:00:00'): 885500, ('1877-10-31 00:00:00'): 10750000}})
     11 
---> 12 df['c'].plot()

/Users/natashawatkins/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in __call__(self, kind, ax, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, label, secondary_y, **kwds)

/Users/natashawatkins/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in plot_series(data, kind, ax, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, label, secondary_y, **kwds)

/Users/natashawatkins/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in _plot(data, x, y, subplots, ax, kind, **kwds)

/Users/natashawatkins/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in generate(self)

/Users/natashawatkins/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in _make_plot(self)

/Users/natashawatkins/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in _is_ts_plot(self)

/Users/natashawatkins/anaconda/lib/python3.5/site-packages/pandas/tools/plotting.py in _use_dynamic_x(self)

/Users/natashawatkins/anaconda/lib/python3.5/site-packages/pandas/tseries/plotting.py in <module>()
      1 # flake8: noqa
      2 
----> 3 from pandas.plotting._timeseries import tsplot

/Users/natashawatkins/anaconda/lib/python3.5/site-packages/pandas/plotting/__init__.py in <module>()
     15                                    parallel_coordinates, lag_plot,
     16                                    autocorrelation_plot)
---> 17 from pandas.plotting._core import boxplot
     18 from pandas.plotting._style import plot_params
     19 from pandas.plotting._tools import table

/Users/natashawatkins/anaconda/lib/python3.5/site-packages/pandas/plotting/_core.py in <module>()
     22 from pandas.core.index import Index, MultiIndex
     23 from pandas.core.series import Series, remove_na
---> 24 from pandas.core.indexes.period import PeriodIndex
     25 from pandas.compat import range, lrange, map, zip, string_types
     26 import pandas.compat as compat

/Users/natashawatkins/anaconda/lib/python3.5/site-packages/pandas/core/indexes/period.py in <module>()
     25 import pandas.tseries.frequencies as frequencies
     26 from pandas.tseries.frequencies import get_freq_code as _gfc
---> 27 from pandas.core.indexes.datetimes import DatetimeIndex, Int64Index, Index
     28 from pandas.core.indexes.timedeltas import TimedeltaIndex
     29 from pandas.core.indexes.datetimelike import DatelikeOps, DatetimeIndexOpsMixin

/Users/natashawatkins/anaconda/lib/python3.5/site-packages/pandas/core/indexes/datetimes.py in <module>()
     36     to_offset, get_period_alias,
     37     Resolution)
---> 38 from pandas.core.indexes.datetimelike import (
     39     DatelikeOps, TimelikeOps, DatetimeIndexOpsMixin)
     40 from pandas.tseries.offsets import DateOffset, generate_range, Tick, CDay

/Users/natashawatkins/anaconda/lib/python3.5/site-packages/pandas/core/indexes/datetimelike.py in <module>()
     20 from pandas.core.dtypes.missing import isnull
     21 from pandas.core import common as com, algorithms
---> 22 from pandas.core.algorithms import checked_add_with_arr
     23 from pandas.core.common import AbstractMethodError
     24 

ImportError: cannot import name 'checked_add_with_arr'

@TomAugspurger
Copy link
Contributor

Something seems off with your installation, as https://github.com/pandas-dev/pandas/blob/master/pandas/core/algorithms.py should be there.

Can you try conda uninstall -f pandas and then conda install pandas?

@natashawatkins
Copy link
Author

Yep that fixed my issue! Strange... thanks :)

@jorisvandenbossche jorisvandenbossche added this to the No action milestone May 12, 2017
@JoshuaC3
Copy link

JoshuaC3 commented Aug 17, 2017

I had a similar issue: ImportError: cannot import name 'PY36'. Which I fixed with:
pip3 install --upgrade pandas --force-reinstall
as I am not using anaconda for that environment.

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

4 participants