导入 Pandas 会出现错误 AttributeError: module 'pandas' has

Importing Pandas gives error AttributeError: module #39;pandas#39; has no attribute #39;core#39; in iPython Notebook(导入 Pandas 会出现错误 AttributeError: module pandas has no attribute core in iPython Notebook) - IT屋-程序员软件开发技术分
本文介绍了导入 Pandas 会出现错误 AttributeError: module 'pandas' has no attribute 'core' in iPython Notebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

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

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'

推荐答案

显然我在尝试导入 pandas 第一次时遇到的错误是 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 语言环境错误

更新我的 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: module 'pandas' has no attribute 'core' in iPython Notebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

python arbitrarily incrementing an iterator inside a loop(python在循环内任意递增迭代器)
Joining a set of ordered-integer yielding Python iterators(加入一组产生 Python 迭代器的有序整数)
Iterating over dictionary items(), values(), keys() in Python 3(在 Python 3 中迭代字典 items()、values()、keys())
What is the Perl version of a Python iterator?(Python 迭代器的 Perl 版本是什么?)
How to create a generator/iterator with the Python C API?(如何使用 Python C API 创建生成器/迭代器?)
Python generator behaviour(Python 生成器行为)