pandas.DataFrame.squeeze

DataFrame.squeeze(axis=None)[source]

Squeeze length 1 dimensions.

Parameters:

axis : None, integer or string axis name, optional

The axis to squeeze if 1-sized.

New in version 0.20.0.

Returns:

scalar if 1-sized, else original object

Scroll To Top