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
Ref: https://github.com/pandas-dev/pandas/pull/43213/files#r699680952
Example:
df = pd.DataFrame({'a': [1], 'b': [2]}) print(df.T.dtypes) df['b'] = df['b'].astype('Int64') print(df.T.dtypes)
gives int64 for the first example, and object for the 2nd. However, the 2nd arguably would be better off as Int64.
The code from #43213 could be used in the transpose method, something akin to
from pandas.core.dtypes.cast import find_common_type df = pd.DataFrame({'a': [1], 'b': [2]}) df['b'] = df['b'].astype('Int64') common_type = find_common_type(df.dtypes.tolist()) print(df.T.astype(common_type, copy=False).dtypes)
Perhaps there are undesirable side-effects by doing this?
The text was updated successfully, but these errors were encountered:
Shout it from the rooftops: the solution is 2D EAs
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Ref: https://github.com/pandas-dev/pandas/pull/43213/files#r699680952
Example:
gives int64 for the first example, and object for the 2nd. However, the 2nd arguably would be better off as Int64.
The code from #43213 could be used in the transpose method, something akin to
Perhaps there are undesirable side-effects by doing this?
The text was updated successfully, but these errors were encountered: