Table Of Contents

Search

Enter search terms or a module, class or function name.

pandas.DataFrame.diff

DataFrame.diff(periods=1, axis=0)[source]

1st discrete difference of object

Parameters:

periods : int, default 1

Periods to shift for forming difference

axis : {0 or ‘index’, 1 or ‘columns’}, default 0

Take difference over rows (0) or columns (1).

New in version 0.16.1.

Returns:

diffed : DataFrame

Scroll To Top