Panda's info() to HTML

Viewed 2453

Pandas offers some summary statistics with the describe() function called on a DataFrame. The output of the function is another DataFrame, so it's easily exported to HTML with a call to to_html().

It also offers information about the DataFrame with the info() function, but that's printed out, returning None. Is there a way to get the same information as a DataFrame or any other way that can be exported to HTML?

Here is a sample info() for reference:

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 5 entries, 0 to 4
Data columns (total 7 columns):
0    5 non-null float64
1    5 non-null float64
2    5 non-null float64
3    5 non-null float64
4    5 non-null float64
5    5 non-null float64
6    5 non-null float64
dtypes: float64(7)
memory usage: 360.0 bytes
4 Answers
Related