-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Labels
BugConstructorsSeries/DataFrame/Index/pd.array ConstructorsSeries/DataFrame/Index/pd.array ConstructorsDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsIndexRelated to the Index class or subclassesRelated to the Index class or subclasses
Milestone
Description
Code Sample, a copy-pastable example if possible
Manually specifying a dtype does not garantuee the output is in that dtype. Eg with Series if incompatible data is passed, an error is raised, while for Index it just silently outputs another dtype:
In [11]: pd.Series(['a', 'b', 'c'], dtype='int64')
...
ValueError: invalid literal for int() with base 10: 'a'
In [12]: pd.Index(['a', 'b', 'c'], dtype='int64')
Out[12]: Index(['a', 'b', 'c'], dtype='object')
Metadata
Metadata
Assignees
Labels
BugConstructorsSeries/DataFrame/Index/pd.array ConstructorsSeries/DataFrame/Index/pd.array ConstructorsDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsIndexRelated to the Index class or subclassesRelated to the Index class or subclasses