Index Dtype Not Preserved During read_fwf #21555
Labels
Bug
Dtype Conversions
Unexpected or buggy dtype conversions
Duplicate Report
Duplicate issue or pull request
IO Data
IO issues that don't fit into a more specific label
Code Sample (copy-pastable, MCVE)
Consider the following code:
Problem description
As I understand the documentation about control switches:
Both output should be equal but it is not.
When indexing at once using
index_col
switch, column is inferred to beint
and casted, making the switchdtype
useless in this case.Expected Output
I think the expected output of:
Should be equal to:
If not, it just makes no sense to be able to protect columns from casting using
dtype
switch.For this reason, I think it is a kind of slight bug or inconsistency.
Anyway, as provided in MCVE above, there exists a solution to circonvolve the problem.
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: