Loading tutorials
df.method_a().method_b().method_c() as one expression. It works because most pandas methods return a new object and leave the original unchanged. This chapter explains that behavior, how to check it yourself, and the cases where it fails. Later chapters build on it with `ass5 min readgroupby aggregation. You should also know that most pandas methods return a new DataFrame, which the previous chapters covered. The code here uses only methods you already know,5 min readgroupby. It also assumes you know that most DataFrame methods return a new DataFrame, which the earlier chapters covered. Here you will meet the five methods that appear in most real cha6 min readDataFrame.assign, the method that adds or replaces columns without changing the original DataFrame. It assumes you can build a DataFrame, select columns, and write a lambda. It also assumes you know that most pandas methods return a new object, which the first chapters of this 5 min readassign accepts callables, usually lambdas, and why a plain reference to a variable often gives wrong results in the middle of a chain. It assumes you can write basic Python functions and lambdas, build and inspect a DataFrame, and filter rows and select columns. It also a6 min readassign to add a single column. It also assumes you know that assign returns a new DataFrame. The chapter covers what happens when one assign call creates several columns and a later column needs an earlie6 min readassign calls with lambdas, as in the earlier chapters, and that you know basic groupby and agg. You should also know how Python's ** unpacking works for function calls, th5 min readgroupby and agg work. It also assumes you have seen a short chain of methods like .query(...).sort_values(...). Here you will learn what pipe does, how to write functions that fit 5 min readassign with lambdas, and write a plain Python function with positional and keyword parameters. It also assumes you have already used pipe to run a one-argument function in a chain. Here you will see how pipe passes extra arguments, what hap5 min readassign, you know how DataFrame.pipe calls a function with the DataFrame as its first argument, and you are comfortable with Python functions, default arguments, and functools.partial. Earlier chapters showed that pipe lets you place your5 min readassign and query, and that you know how pipe passes a DataFrame to a function. It also assumes you are comfortable with Python functions and lambdas. The goal is to look inside a chain while it runs, without splitting it into temporary vari5 min readassign, query, groupby/agg and pipe, and that you know why pandas methods return new DataFrames. It covers the mistakes that break chains or make them misleading, and how to decide when a chain has stopped helping.5 min read