python - 导入错误 : cannot import name 'Timestamp'

标签 python ggplot2 python-ggplot

我已使用以下代码在我的 python 3.6.3 中成功安装了 ggplot:

conda install -c conda-forge ggplot 

但是当我使用下面的代码将它导入我的笔记本时,我收到了一个错误:

from ggplot import *
ImportError: cannot import name 'Timestamp'

如果我能解决这个问题,我将不胜感激。

最佳答案

我也遇到了同样的问题。

请转到 .../site-packages/ggplot/stats/smoothers.py 并更改

from pandas.lib import Timestamp

from pandas import Timestamp

然后保存。

关于python - 导入错误 : cannot import name 'Timestamp' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50591982/

相关文章:

python - 使用 Discord.py 重写创建计数器机器人 - 分配错误之前引用的局部变量 'counter'

python - 识别录制声音中的音符 - Python

r - 在 R ggplot2 中位置 = "fill"的条形图上绘制标签

r - 如何按其中一行的子集的平均值对数据框进行排序?

python - Matplotlib:覆盖 "ggplot"默认样式属性

python - Django:ImageField 需要文件路径还是实际的图像对象?

python - 在 Mac 上安装 pyobjc

r - 自定义 ggplot2 Axis 和标签格式

python - 使用 ggplot 和 pandas 在 Python 中绘制事件密度

ipython - 无法在 iPython 中导入 ggplot 模块