From 3f35a89ba36bade4bc9f83029e4d0917f1c1a6d1 Mon Sep 17 00:00:00 2001 From: gustavovargas Date: Mon, 22 May 2023 13:23:18 +0200 Subject: [PATCH 1/3] DOC: fix docstring for .pct_change --- pandas/core/generic.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index f14c6595686ae..5be85f30615ea 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11133,12 +11133,16 @@ def pct_change( **kwargs, ) -> Self: """ - Percentage change between the current and a prior element. + Fractional change between the current and a prior element. - Computes the percentage change from the immediately previous row by - default. This is useful in comparing the percentage of change in a time + Computes the fractional change from the immediately previous row by + default. This is useful in comparing the fraction of change in a time series of elements. + Despite the name of this method, it calculates fractional change (also + known as per unit change or relative change) and not percentage change. + If you need the percentage change, multiply these values by 100. + Parameters ---------- periods : int, default 1 From 717631f4fbeacee59f2736a68fc0ff5ba280cc1f Mon Sep 17 00:00:00 2001 From: gustavovargas Date: Mon, 22 May 2023 13:40:19 +0200 Subject: [PATCH 2/3] DOC: fix docstring for .pct_change --- pandas/core/generic.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 5be85f30615ea..ccf229d3d2a1e 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11139,9 +11139,12 @@ def pct_change( default. This is useful in comparing the fraction of change in a time series of elements. - Despite the name of this method, it calculates fractional change (also - known as per unit change or relative change) and not percentage change. - If you need the percentage change, multiply these values by 100. + .. note:: + + Despite the name of this method, it calculates fractional change + (also known as per unit change or relative change) and not + percentage change. If you need the percentage change, multiply + these values by 100. Parameters ---------- From 2c8d069a6fb228dffd76983ad5156206f94224db Mon Sep 17 00:00:00 2001 From: gustavovargas Date: Mon, 22 May 2023 16:04:24 +0200 Subject: [PATCH 3/3] DOC: change to comply with black code formatter --- pandas/core/generic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index ccf229d3d2a1e..05b60cd278758 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11141,9 +11141,9 @@ def pct_change( .. note:: - Despite the name of this method, it calculates fractional change - (also known as per unit change or relative change) and not - percentage change. If you need the percentage change, multiply + Despite the name of this method, it calculates fractional change + (also known as per unit change or relative change) and not + percentage change. If you need the percentage change, multiply these values by 100. Parameters