Skip to content

Commit ac74fce

Browse files
Copilotxadupre
andauthored
Add concrete documentation example for plot_waterfall
Agent-Logs-Url: https://github.com/sdpython/teachpyx/sessions/242bb04a-1d52-4f54-a254-e242a90f9ed5 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
1 parent 90a5382 commit ac74fce

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

_doc/api/tools/pandas.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22
teachpyx.tools.pandas
33
=====================
44

5+
Exemple
6+
-------
7+
8+
.. plot::
9+
10+
import pandas
11+
import matplotlib.pyplot as plt
12+
from teachpyx.tools.pandas import plot_waterfall
13+
14+
plt.close("all")
15+
16+
df = pandas.DataFrame({"name": ["A", "B", "C"], "delta": [10, -3, 5]})
17+
ax, _ = plot_waterfall(df, "delta", "name", total_label="TOTAL")
18+
ax.set_title("Exemple de waterfall")
19+
plt.xticks(rotation=30, ha="right")
20+
plt.tight_layout()
21+
plt.show()
22+
523
.. automodule:: teachpyx.tools.pandas
624
:members:
725
:no-undoc-members:

0 commit comments

Comments
 (0)