Description
In our continuous integration we validate that all the examples in the documentation follow PEP-8, and are valid code that can run.
Currently, we're skipping the essential basic functionality page, because the examples showing the pipe
functionality can't be run, because the variables it uses are not defined. The example can be seen here:
https://github.com/pandas-dev/pandas/blame/master/doc/source/getting_started/basics.rst#L765
What we should do is to replace this example, by a real-world example, where the data is previously created. This way users will be able to run the code, and also will understand better a real-world case where .pipe()
can be used.
A great resource for understanding pipe
and to get inspiration for an example is this blog post: https://tomaugspurger.github.io/method-chaining
What needs to be done here is:
- Add a minimalistic DataFrame with somehow real-world data.
- Create couple of one-liner functions that can be used with pipe and the dataset created, in a meaningful way.
- Make sure that the example is not overcomplicated, and that the data and the functions are so simple that the reader can focus all their attention to understanding
pipe
and method chaining. - Start validating the code in the file (i.e. remove this line: https://github.com/pandas-dev/pandas/blob/master/setup.cfg#L49)