DOC: add FAQ about np.datetime64 #5625

Merged
merged 1 commit into from Feb 14, 2016

Conversation

Projects
None yet
4 participants
Owner

tacaswell commented Dec 6, 2015

I would appreciate if someone else checked to make sure I am not lying here, but with up-to-date everything, datetime64 seems to 'just work' so long as pandas has been imported.

Owner

tacaswell commented Dec 6, 2015

and of course I targeted this at the wrong branch.

@mdboom mdboom commented on an outdated diff Dec 14, 2015

doc/faq/howto_faq.rst
@@ -14,6 +14,35 @@ How-To
Plotting: howto
===============
+.. _howto-datetime64
@mdboom

mdboom Dec 14, 2015

Owner

I think this needs a colon at the end of the line.

Owner

tacaswell commented Dec 16, 2015

fixed and force pushed

@QuLogic QuLogic commented on an outdated diff Dec 16, 2015

doc/faq/howto_faq.rst
+
+For matplotlib to plot dates (or any scalar with units) a converter
+to float needs to be registered with the `matplolib.units` module. The
+current best converters for `datetime64` values are in `pandas`. Simply
+importing `pandas` ::
+
+ import pandas as pd
+
+should be sufficient as `pandas` will try to install the converters
+on import. If that does not work, or you need to reset `munits.registry`
+you can explicitly install the `pandas` converters by ::
+
+ from pandas.tseries import converter as pdtc
+ pdtc.register()
+
+If you only want to use `pandas` converter for `datetime64` values ::
@QuLogic

QuLogic Dec 16, 2015

Member

use the

Member

QuLogic commented Dec 16, 2015

Don't you need double-backticks for code samples in reST?

Owner

tacaswell commented Dec 16, 2015

Single backticks to their best to auto-resolve to a link to something else in the docs, double ticks just sets it in mono-typewriter.

Owner

efiring commented Feb 14, 2016

@tacaswell, my quick testing confirms your initial comment: importing pandas is sufficient.

@tacaswell tacaswell DOC: add FAQ about np.datetime64
00796b2
Owner

tacaswell commented Feb 14, 2016

Typo fixed and squashed.

@efiring efiring added a commit that referenced this pull request Feb 14, 2016

@efiring efiring Merge pull request #5625 from tacaswell/faq_datetime64
DOC: add FAQ about np.datetime64
a40c9ec

@efiring efiring merged commit a40c9ec into matplotlib:master Feb 14, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

efiring removed the needs_review label Feb 14, 2016

Member

QuLogic commented Feb 14, 2016

Should be backported?

tacaswell deleted the tacaswell:faq_datetime64 branch May 12, 2016

@QuLogic QuLogic added a commit to QuLogic/matplotlib that referenced this pull request Oct 16, 2016

@efiring @QuLogic efiring + QuLogic Merge pull request #5625 from tacaswell/faq_datetime64
DOC: add FAQ about np.datetime64
e2fd2aa
Member

QuLogic commented Oct 18, 2016

Backported to v2.x via e2fd2aa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment