-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
DatetimeIndex constructor should accept set #882
Comments
There's a related open issue on The problem here is that an >>> pd.Index(set([1,2]))
Index([1, 2], dtype='int64')
>>> pd.Index(set([2,1]))
Index([1, 2], dtype='int64') We decided for the stubs to disallow sets because the behavior for |
We often use |
We discussed this in the pandas dev meeting and the intent is to (eventually) disallow sets with import pandas as pd
def main() -> None:
s = {pd.Timestamp(2020, 1, 1), pd.Timestamp(2021, 1, 2)}
l = [pd.Timestamp(2020, 1, 1), pd.Timestamp(2021, 1, 2)]
idx = pd.DatetimeIndex(list(s))
print(idx)
idx2 = pd.DatetimeIndex(l)
print(idx2) |
Describe the bug
Providing a
set
to theDatetimeIndex
constructor is rejected.To Reproduce
pandas
example that is not properly checked by the stubs.mypy
orpyright
).mypy
Please complete the following information:
pandas-stubs
2.1.4The text was updated successfully, but these errors were encountered: