Loading tutorials
groupby with simple aggregation. The previous chapter explained why chaining works: most pandas methods return a new object. Here you use that fact3 min readgroupby in pandas. Here you will meet the five methods that make up most chains: rename, query, sort_values, reset_index, and groupby with agg. Each takes a DataFrame and returns a new object, so you can attach t2 min readassign.2 min readassign to add a column. It explains why the value you give assign is usually a lambda, and what goes wrong without one.2 min readassign with a lambda to add one column. Here you will create several columns in a single assign call, where later columns use earlier ones.2 min readassign with lambdas, as covered in the earlier chapters on assign. It also assumes you know basic Python dictionaries and the ** unpacking syntax.2 min readgroupby with basic aggregation. You should also know that assign adds columns inside a chain. Here you will learn how pipe lets your own functions take part in the same chain.2 min readDataFrame.pipe to put a function into a chain. The goal here is to pass extra arguments through pipe, and to handle functions that do not take the DataFrame as their first parameter.2 min readassign and pipe in a chain, and run groupby aggregations. It covers how to write functions that work well inside pipe and can be reused across projects.2 min readassign, query, and sort_values, and that you know how pipe passes a DataFrame to a function. The sample df is the four-row orders table used earlier.2 min readassign, pipe, and groupby in a chain. Chains are easy to write and easy to overuse. Here are the failures you are most likely to hit and a way to decide when to stop.3 min read