Skip to content

pandas/matplotlib datetime conflict #13713

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

Closed
ocehugo opened this issue Jul 20, 2016 · 1 comment
Closed

pandas/matplotlib datetime conflict #13713

ocehugo opened this issue Jul 20, 2016 · 1 comment
Labels
Duplicate Report Duplicate issue or pull request Visualization plotting

Comments

@ocehugo
Copy link

ocehugo commented Jul 20, 2016

Description

Importing pandas makes plotting with matplotlib and standard datetime objects impossible.

A type error is raised in matplotlib because pandas import datetime and "override the global" one.

I would not expect pandas to override the default datetime. After importing pandas one cannot use datetimes for plotting for example.

PS: just reposting this from matplotlib issue 6796

Code Sample, a copy-pastable example if possible

import datetime
import matplotlib.pyplot as plt
# this works
x = [datetime.date(1677,1,1) + datetime.timedelta(days=i) for i in range(10)]
plt.plot(x,range(10))
import pandas as pd
# do not work anymore
x = [datetime.date(1677,1,1) + datetime.timedelta(days=i) for i in range(10)]
plt.plot(x,range(10))

Expected Output

datetime would not be "change".

output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Darwin
OS-release: 15.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_AU.utf-8

pandas: 0.18.1
nose: 1.3.7
pip: 8.1.2
setuptools: 21.0.0
Cython: 0.24
numpy: 1.11.0
scipy: 0.17.0
statsmodels: 0.6.1
xarray: 0.7.2
IPython: 4.2.0
sphinx: 1.3.5
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.1
openpyxl: 2.3.3
xlrd: 0.9.4
xlwt: None
xlsxwriter: None
lxml: 3.6.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.13
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.40.0
pandas_datareader: None

@TomAugspurger
Copy link
Contributor

Thanks, duplicate of #2579.

@TomAugspurger TomAugspurger added Visualization plotting Duplicate Report Duplicate issue or pull request labels Jul 20, 2016
@jreback jreback added this to the No action milestone Jul 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request Visualization plotting
Projects
None yet
Development

No branches or pull requests

3 participants