Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Recognize pandas Timestamp objects for DateConverter? #10533

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

I am testing matplotlib 2.2rc from a point of view of "what if pandas no longer registers its unit converters", and one of the issues raised when we temporarily did that for the 0.21.0 release was the following (pandas-dev/pandas#18283):

Code for reproduction

importpandasaspdimportmatplotlib.pyplotaspltpd.plotting.deregister_matplotlib_converters()xticks=pd.date_range(start="10/10/2017",end="11/11/2017",freq='D')plt.xticks(xticks,xticks.strftime("%a %m-%d"))

Actual outcome

The above raisesTypeError: Cannot compare type 'Timestamp' with type 'float', because Timestamps are not recognized to use theDateConverter in the units framework.

Would it be possible to consider adding pandas Timestamps to the unit registry? It are subclasses ofdatetime.datetime, so code-wise it should not be hard to add support.

Matplotlib version

  • Operating system: Linux
  • Matplotlib version: '2.2.0rc1'
  • Python version: 3.5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp