w3resource

Pandas DataFrame - expanding() function

DataFrame - expanding() function

The expanding() function is used to provide expanding transformations.

Syntax:

DataFrame.expanding(self, min_periods=1, center=False, axis=0)

Parameters:

Name Description Type/Default Value Required / Optional
min_periods Minimum number of observations in window required to have a value (otherwise result is NA). int
Default Value: 1
Required
center Set the labels at the center of the window. bool
Default Value: False
Required
axis    int or str
Default Value: 0
Required

Returns: a Window sub-classed for the particular operation

Notes:

By default, the result is set to the right edge of the window. This can be changed to the center of the window by setting center=True.

Example:


Download the Pandas DataFrame Notebooks from here.

Previous: DataFrame - rolling() function
Next: DataFrame - ewm() function



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/pandas/dataframe/dataframe-expanding.php