导入 pandas 会导致错误AttributeError:iPython Notebook中模块'pandas'没有属性'core' [英] Importing Pandas gives error AttributeError: module 'pandas' has no attribute 'core' in iPython Notebook

查看:426
本文介绍了导入 pandas 会导致错误AttributeError:iPython Notebook中模块'pandas'没有属性'core'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过Anaconda Navigator应用程序(版本1.1.0)运行iPython笔记本. 当我想导入大熊猫时,它给了我一个奇怪的错误.我以为Anaconda应用程序包括熊猫包了?

I am running a iPython notebook via the Anaconda Navigator app (version 1.1.0). When I want to import pandas it gives me a strange error. I thought the Anaconda app included the pandas package?

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-af55e7023913> in <module>()
----> 1 import pandas as pd

/Users/bertcarremans/anaconda/lib/python3.5/site-packages/pandas/__init__.py in <module>()
 37 import pandas.core.config_init
 38 
---> 39 from pandas.core.api import *
 40 from pandas.sparse.api import *
 41 from pandas.stats.api import *

/Users/bertcarremans/anaconda/lib/python3.5/site-packages/pandas/core/api.py in <module>()
  8 from pandas.core.common import isnull, notnull
  9 from pandas.core.categorical import Categorical
---> 10 from pandas.core.groupby import Grouper
 11 from pandas.core.format import set_eng_float_format
 12 from pandas.core.index import (Index, CategoricalIndex, Int64Index,

/Users/bertcarremans/anaconda/lib/python3.5/site-packages/pandas/core/groupby.py in <module>()
 16                               DataError, SpecificationError)
 17 from pandas.core.categorical import Categorical
---> 18 from pandas.core.frame import DataFrame
 19 from pandas.core.generic import NDFrame
 20 from pandas.core.index import (Index, MultiIndex, CategoricalIndex,

/Users/bertcarremans/anaconda/lib/python3.5/site-packages/pandas/core/frame.py in <module>()
 37                                    create_block_manager_from_arrays,
 38                                    create_block_manager_from_blocks)
---> 39 from pandas.core.series import Series
 40 from pandas.core.categorical import Categorical
 41 import pandas.computation.expressions as expressions

/Users/bertcarremans/anaconda/lib/python3.5/site-packages/pandas/core/series.py in <module>()
 33 from pandas.core.internals import SingleBlockManager
 34 from pandas.core.categorical import Categorical, CategoricalAccessor
---> 35 import pandas.core.strings as strings
 36 from pandas.tseries.common import (maybe_to_datetimelike,
 37                                    CombinedDatetimelikeProperties)

AttributeError: module 'pandas' has no attribute 'core'

推荐答案

显然,我第一次尝试导入大熊猫时遇到的错误是ValueError: unknown locale: UTF-8

Apparently the error I got when trying to import pandas for the first time was ValueError: unknown locale: UTF-8

此后尝试再次导入,又出现了我上面的问题中所述的另一个错误.

Trying to import again afterwards, gave another error as described in my question above.

我在 IPython Notebook区域设置错误上找到了解决ValueError的解决方案

I found the solution to solve the ValueError on IPython Notebook locale error

更新我的bash配置文件后,错误AttributeError: module 'pandas' has no attribute 'core'不再出现.

After updating my bash profile, the error AttributeError: module 'pandas' has no attribute 'core' did not appear anymore.

这篇关于导入 pandas 会导致错误AttributeError:iPython Notebook中模块'pandas'没有属性'core'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆