Skip to content
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

Add "time" attribute to "DatetimeIndex" #96

Closed
claudio-ebel opened this issue Oct 12, 2021 · 2 comments
Closed

Add "time" attribute to "DatetimeIndex" #96

claudio-ebel opened this issue Oct 12, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@claudio-ebel
Copy link

The time attribute of DatetimeIndex seems not to be implemented.

Minimal working example:

# file tmp.py
import pandas as pd

dr = pd.date_range(start='2020-1-1', periods=3)
print(dr.time)

Then executing mypy tmp.py results in

tmp.py:5: error: "DatetimeIndex" has no attribute "time"
Found 1 error in 1 file (checked 1 source file)

while the execution python tmp.py of the code works perfectly. Tested with

Python 3.9.7
numpy==1.21.2
pandas==1.3.2
pandas-stubs==1.2.0.22
@zkrolikowski-vl
Copy link
Collaborator

Hi @claudio-ebel. Thanks for reporting the issue. I'll prepare an appropriate fix for you and pass your PR for review.

@zkrolikowski-vl zkrolikowski-vl added the bug Something isn't working label Oct 13, 2021
@zkrolikowski-vl zkrolikowski-vl self-assigned this Oct 13, 2021
@zkrolikowski-vl
Copy link
Collaborator

No solution was provided but pandas-stubs has moved to another repository and will now be managed alongside pandas itself: https://github.com/pandas-dev/pandas-stubs

You might try using the newest version pip install pandas-stubs==1.4.2.220626 which comes from that repository. If it doesn't work please considering opening an issue in the new repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants