Using the ggplot module in python (Timestamp problem in the new version of pandas)

During the process of migrating Python from R language, I accidentally discovered the ggplot module, which can meet the needs of using R language ggplot2 visualization in Python.

ggplot module installation

  • Install with pip
pip install ggplot
  • Install with easy_install
easy_install ggplot
  • Log in to the python third-party module library to download

Log in to the URL ( https://pypi.org/  ) to retrieve ggplot, and decompress the downloaded compressed file to the python module installation directory.


call ggplot

  • After the installation is complete, enter the ipython editor;

  • Return the following error;

  • After confirming that the ggplot module is complete, combined with the error report, it is inferred that the update of the pandas module version that the ggplot module depends on causes Timestamp to fail to import. The Timestamp class of the pandas module of version 0.23.3 is directly defined under pandas instead of pandas.lib;

  • Open the smoothers.py file and modify from pandas.lib import Timestamp to from pandas import Timestamp;

  • Save the modification of the file and re-import to solve it. 

Related Posts