Skip to content

Commit 3b41f96

Browse files
committed
fixed ValueError thrown when using Series.info(showcounts=False)
1 parent 8476e0f commit 3b41f96

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/io/formats/info.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,8 @@ def headers(self) -> Sequence[str]:
10961096

10971097
def _gen_rows_without_counts(self) -> Iterator[Sequence[str]]:
10981098
"""Iterator with string representation of body data without counts."""
1099-
yield from self._gen_dtypes()
1099+
for dtype in self._gen_dtypes():
1100+
yield [dtype]
11001101

11011102
def _gen_rows_with_counts(self) -> Iterator[Sequence[str]]:
11021103
"""Iterator with string representation of body data with counts."""
@@ -1108,4 +1109,4 @@ def _get_dataframe_dtype_counts(df: DataFrame) -> Mapping[str, int]:
11081109
Create mapping between datatypes and their number of occurrences.
11091110
"""
11101111
# groupby dtype.name to collect e.g. Categorical columns
1111-
return df.dtypes.value_counts().groupby(lambda x: x.name).sum()
1112+
return df.dtypes.value_counts().groupby(lambda x: x.name).sum()

0 commit comments

Comments
 (0)