We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In [16]: import pandas as pd ...: import numpy as np ...: pd.DataFrame(['a', 1, np.nan]).to_excel('test.xlsx') ...: df_str = pd.read_excel('test.xlsx', dtype=str, names=['col_str']) ...: df_str['type_str'] = df_str.col_str.map(type) ...: df_obj = pd.read_excel('test.xlsx', dtype=object, names=['col_obj']) ...: df_obj['type_obj'] = df_obj.col_obj.map(type) ...: pd.concat([df_str, df_obj], axis=1) ...: Out[16]: col_str type_str col_obj type_obj 0 a <class 'str'> a <class 'str'> 1 1 <class 'str'> 1 <class 'int'> 2 nan <class 'str'> NaN <class 'float'>
I imagine read_excel's dtype parameter description should just read "Use object to preserve and not interpret dtype" and not "Use str or object".
dtype
The text was updated successfully, but these errors were encountered:
Yes - looks like I copied the read_csv docstring - PR welcome!
read_csv
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Code Sample, a copy-pastable example if possible
Problem description
I imagine read_excel's
dtype
parameter description should just read "Use object to preserve and not interpret dtype" and not "Use str or object".The text was updated successfully, but these errors were encountered: