eda_mds.info_na

Module Contents

Functions

info_na(df)

Extend pandas.DataFrame.info() with row-level null value statistics.

eda_mds.info_na.info_na(df)[source]

Extend pandas.DataFrame.info() with row-level null value statistics.

This function enhances the DataFrame.info() method by adding a summary of null values at the row level. It prints type, shape, memory usage, and column information, along with new statistics such as the count and percentage of null values in rows, providing a comprehensive characterization of the DataFrame’s structure.

Parameters:

df (pandas.DataFrame) – The DataFrame to be analyzed for null value statistics.

Returns:

The function prints detailed descriptive information to the console and returns None.

Return type:

None

Examples

>>> df_example = pd.DataFrame(
        [
            [np.nan, 13, "hello"],
            [np.nan, np.nan, "this"],
            [37, 45, "is"],
            [256, 31, ""],
            [1, np.nan, "test"],
        ],
        index=["First", "Second", "Third", "Fourth", "Fifth"],
        columns=["Column1", "ColumnNumber2", "Column3"],
    )
>>> info_na(df_example)
# Expected output format:
type: <class 'pandas.core.frame.DataFrame'>
shape: (5, 3)
memory usage: 692 B
...