xxxxxxxxxx
>>> import io
>>> buf = io.StringIO()
>>> df.info(buf=buf)
>>> s = buf.getvalue()
>>> type(s)
<class 'str'>
>>> print(s)
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 5 entries, 0 to 4
Data columns (total 2 columns):
a 5 non-null float64
b 5 non-null float64
dtypes: float64(2)
memory usage: 160.0 bytes