Pandas to Pathway Cheat Sheet

OperationPandasPathway
Selecting columnsdf[['colA', 'colB', ...]]t.select(t.colA, t['colB'], pw.this.colC)
Filtering on a given valuedf[df['name'] == value]t.filter(t.name == value)
Filtering on a conditiondf[condition]t.filter(condition)
Group-by and Aggregationdf.groupby('name').sum()t.groupby(pw.this.name).reduce(sum=pw.reducers.sum(pw.this.value))
Applying a functiondf['c'] = func(df['a'], df['b'], ..)t.select(c=pw.apply(func, t.a, t.b))
Join Operationsdf1.join(df2, on='name')t1.join(t2, pw.left.name == pw.right.name).select(...)
Reading CSV filesdf = pd.read_csv('file_name')t = pw.io.csv.read('./data/', schema=InputSchema)
Writing to CSV filespd.to_csv('file_name')pw.io.csv.write(table, './output/')
Accessing a row by labeldf.loc[[label]]Using joins or ix_ref
Accessing a row by indexdf.iloc[0]No equivalence as location-based indexes don't make sense with changing table data.