diff --git a/pandas/io/formats/info.py b/pandas/io/formats/info.py index 89b5e45dbb3a2..1ba52e7d8be12 100644 --- a/pandas/io/formats/info.py +++ b/pandas/io/formats/info.py @@ -1096,7 +1096,8 @@ def headers(self) -> Sequence[str]: def _gen_rows_without_counts(self) -> Iterator[Sequence[str]]: """Iterator with string representation of body data without counts.""" - yield from self._gen_dtypes() + for dtype in self._gen_dtypes(): + yield [dtype] def _gen_rows_with_counts(self) -> Iterator[Sequence[str]]: """Iterator with string representation of body data with counts.""" @@ -1108,4 +1109,4 @@ def _get_dataframe_dtype_counts(df: DataFrame) -> Mapping[str, int]: Create mapping between datatypes and their number of occurrences. """ # groupby dtype.name to collect e.g. Categorical columns - return df.dtypes.value_counts().groupby(lambda x: x.name).sum() + return df.dtypes.value_counts().groupby(lambda x: x.name).sum() \ No newline at end of file