DataFrame.info

DataFrame.info(verbose: bool | None = None, buf: StringIO | None = None, max_cols: int | None = None, memory_usage: bool | None = None, show_counts: bool | None = None) None[source]

Print a concise summary of a DataFrame.

This method prints information about a DataFrame including the index dtype and column dtypes, non-null values and memory usage.

See :pandas_api_docs:`pandas.DataFrame.info` for full details.

Notes

This copies a lot of code from pandas.DataFrame.info as it is difficult to split out the appropriate code or creating a SparseDataFrame gives incorrect results on types and counts.

Examples

>>> from tests import OPENSEARCH_TEST_CLIENT
>>> df = oml.DataFrame(OPENSEARCH_TEST_CLIENT, 'ecommerce', columns=['customer_first_name', 'geoip.city_name'])
>>> df.info()
<class 'opensearch_py_ml.dataframe.DataFrame'>
Index: 4675 entries, 0 to 4674
Data columns (total 2 columns):
 #   Column               Non-Null Count  Dtype...
---  ------               --------------  -----...
 0   customer_first_name  4675 non-null   object
 1   geoip.city_name      4094 non-null   object
dtypes: object(2)
memory usage: ...
OpenSearch storage usage: ...