Skip to content

Commit

Permalink
use is_homogeneous_type
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel committed Aug 26, 2019
1 parent 45fd5f6 commit 9f0c098
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ def transpose(self, *args, **kwargs):
nv.validate_transpose(tuple(), kwargs)
result = self._constructor(new_values, **new_axes).__finalize__(self)

if len(self.columns) and (self.dtypes == self.dtypes.iloc[0]).all():
if self.ndim == 2 and self._is_homogeneous_type:
# FIXME: self.dtypes[0] can fail in tests
if is_extension_array_dtype(self.dtypes.iloc[0]):
# Retain ExtensionArray dtypes through transpose;
Expand Down

0 comments on commit 9f0c098

Please sign in to comment.