Skip to content

Commit 1b6bea4

Browse files
committed
docs: fix another typo
1 parent 80961bd commit 1b6bea4

4 files changed

Lines changed: 19 additions & 19 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Here is an excerpt from the customer retention analysis example [notebook](https
108108
ax = dbp.plot(
109109
figsize=(10, 5),
110110
bins=20,
111-
cumlative=True,
111+
cumulative=True,
112112
draw_percentile_line=True,
113113
percentile_line=0.8,
114114
source_text="Source: Transactions in 2023",

docs/analysis_modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ tc = TransactionChurn(transactions, churn_period=churn_period)
737737

738738
tc.plot(
739739
title="Churn Rate by Number of Purchases",
740-
cumlative=True,
740+
cumulative=True,
741741
source_text="Source: PyRetailScience",
742742
)
743743
```

docs/examples/retention.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@
286286
"ax = dbp.plot(\n",
287287
" figsize=(10, 5),\n",
288288
" bins=20,\n",
289-
" cumlative=True,\n",
289+
" cumulative=True,\n",
290290
" percentile_line=0.8,\n",
291291
" source_text=\"Source: Transactions in 2023\",\n",
292292
" title=\"When Do Customers Make Their Next Purchase?\",\n",
@@ -398,7 +398,7 @@
398398
],
399399
"source": [
400400
"tc.plot(\n",
401-
" cumlative=True,\n",
401+
" cumulative=True,\n",
402402
" figsize=(10, 5),\n",
403403
" source_text=\"Source: Transactions in 2023\",\n",
404404
")\n",

pyretailscience/customer.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self, df: pd.DataFrame) -> None:
4343
def plot(
4444
self,
4545
bins: int = 10,
46-
cumlative: bool = False,
46+
cumulative: bool = False,
4747
ax: Axes | None = None,
4848
percentile_line: float | None = None,
4949
source_text: str | None = None,
@@ -56,7 +56,7 @@ def plot(
5656
5757
Args:
5858
bins (int, optional): The number of bins to plot. Defaults to 10.
59-
cumlative (bool, optional): Whether to plot the cumulative distribution. Defaults to False.
59+
cumulative (bool, optional): Whether to plot the cumulative distribution. Defaults to False.
6060
ax (Axes, optional): The Matplotlib axes to plot the graph on. Defaults to None.
6161
percentile_line (float, optional): The percentile to draw a line at. Defaults to None. When None then no
6262
line is drawn.
@@ -70,15 +70,15 @@ def plot(
7070
SubplotBase: The Matplotlib axes of the plot
7171
"""
7272
density = False
73-
if cumlative:
73+
if cumulative:
7474
density = True
7575

7676
if x_label is None:
7777
x_label = "Number of purchases"
7878

7979
ax = self.cust_purchases_s.hist(
8080
bins=bins,
81-
cumulative=cumlative,
81+
cumulative=cumulative,
8282
ax=ax,
8383
density=density,
8484
color=COLORS["green"][500],
@@ -87,8 +87,8 @@ def plot(
8787

8888
ax.xaxis.set_major_formatter(lambda x, pos: human_format(x, pos, decimals=0))
8989

90-
if cumlative:
91-
default_title = "Number of Purchases Cumulative Distribution"
90+
if cumulative:
91+
default_title = "Number of Purchases cumulative Distribution"
9292
default_y_label = "Percentage of customers"
9393
ax.yaxis.set_major_formatter(mtick.PercentFormatter(xmax=1, decimals=0))
9494

@@ -221,7 +221,7 @@ def _calculate_days_between_purchases(df: pd.DataFrame) -> pd.Series:
221221
def plot(
222222
self,
223223
bins: int = 10,
224-
cumlative: bool = False,
224+
cumulative: bool = False,
225225
ax: Axes | None = None,
226226
percentile_line: float | None = None,
227227
title: str | None = None,
@@ -234,7 +234,7 @@ def plot(
234234
235235
Args:
236236
bins (int, optional): The number of bins to plot. Defaults to 10.
237-
cumlative (bool, optional): Whether to plot the cumulative distribution. Defaults to False.
237+
cumulative (bool, optional): Whether to plot the cumulative distribution. Defaults to False.
238238
ax (Axes, optional): The Matplotlib axes to plot the graph on. Defaults to None.
239239
percentile_line (float, optional): The percentile to draw a line at. Defaults to None. When None then no
240240
line is drawn.
@@ -248,12 +248,12 @@ def plot(
248248
SubplotBase: The Matplotlib axes of the plot
249249
"""
250250
density = False
251-
if cumlative:
251+
if cumulative:
252252
density = True
253253

254254
ax = self.purchase_dist_s.hist(
255255
bins=bins,
256-
cumulative=cumlative,
256+
cumulative=cumulative,
257257
ax=ax,
258258
density=density,
259259
color=COLORS["green"][500],
@@ -264,8 +264,8 @@ def plot(
264264

265265
ax = standard_graph_styles(ax)
266266

267-
if cumlative:
268-
default_title = "Average Days Between Purchases Cumulative Distribution"
267+
if cumulative:
268+
default_title = "Average Days Between Purchases cumulative Distribution"
269269
default_y_label = "Percentage of Customers"
270270
ax.yaxis.set_major_formatter(mtick.PercentFormatter(xmax=1, decimals=0))
271271

@@ -370,7 +370,7 @@ def __init__(self, df: pd.DataFrame, churn_period: float) -> None:
370370

371371
def plot(
372372
self,
373-
cumlative: bool = False,
373+
cumulative: bool = False,
374374
ax: Axes | None = None,
375375
title: str | None = None,
376376
x_label: str | None = None,
@@ -381,7 +381,7 @@ def plot(
381381
"""Plot the churn rate by number of purchases.
382382
383383
Args:
384-
cumlative (bool, optional): Whether to plot the cumulative distribution. Defaults to False.
384+
cumulative (bool, optional): Whether to plot the cumulative distribution. Defaults to False.
385385
ax (Axes, optional): The Matplotlib axes to plot the graph on. Defaults to None.
386386
title (str, optional): The title of the plot. Defaults to None.
387387
x_label (str, optional): The x-axis label. Defaults to None.
@@ -392,7 +392,7 @@ def plot(
392392
Returns:
393393
SubplotBase: The Matplotlib axes of the plot
394394
"""
395-
if cumlative:
395+
if cumulative:
396396
cumulative_churn_rate_s = self.purchase_dist_df["churned"].cumsum().div(self.n_unique_customers)
397397
ax = cumulative_churn_rate_s.plot.area(
398398
color=COLORS["green"][500],

0 commit comments

Comments
 (0)