Skip to content

Commit f4c819b

Browse files
zxqfd555Manul from Pathway
authored andcommitted
improve groupby tutorial (#10208)
GitOrigin-RevId: 5c40ebf69bd181513feaab356480b08595008546
1 parent 876dc06 commit f4c819b

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

  • docs/2.developers/4.user-guide/30.data-transformation/.indexing-grouped-tables

docs/2.developers/4.user-guide/30.data-transformation/.indexing-grouped-tables/article.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@
2828
# Imagine you've just been assigned a new project: analyzing salary statistics in your company.
2929
# In particular, your goal is to determine the number of employees who earn more than the average salary in each department.
3030
#
31-
# Let's consider the following table:
31+
# Let's consider the following table, where each row represents an employee identified by their `name`, along with their `salary` and `department`:
3232

3333
# %%
3434
import pathway as pw
3535

3636
salaries = pw.debug.table_from_markdown(
3737
"""
38-
salary | department
39-
1800 | Sales
40-
2000 | Finance
41-
2300 | Sales
42-
2700 | Finance
43-
1900 | Finance
38+
name | salary | department
39+
Alice | 1800 | Sales
40+
Bob | 2000 | Finance
41+
Charlie | 2300 | Sales
42+
Dave | 2700 | Finance
43+
Eve | 1900 | Finance
4444
"""
4545
)
4646
pw.debug.compute_and_print(salaries)
@@ -101,17 +101,17 @@
101101
#
102102
# We can also use `ix_ref` to index using tuples of values by using `ix_ref(*args)`.
103103
#
104-
# For example, let's say we have an extra column `position`:
104+
# For example, let's say we have an extra column `position` alongside the existing `name`, `salary`, and `department` columns:
105105

106106
# %%
107107
salaries_with_position = pw.debug.table_from_markdown(
108108
"""
109-
salary | department | position
110-
1800 | Sales | junior
111-
2000 | Finance | junior
112-
2300 | Sales | senior
113-
2700 | Finance | senior
114-
1900 | Finance | junior
109+
name | salary | department | position
110+
Alice | 1800 | Sales | junior
111+
Bob | 2000 | Finance | junior
112+
Charlie | 2300 | Sales | senior
113+
Dave | 2700 | Finance | senior
114+
Eve | 1900 | Finance | junior
115115
"""
116116
)
117117

0 commit comments

Comments
 (0)