|
| 1 | +--- |
| 2 | +category: "london" |
| 3 | +title: "pandas visualisation vol.2" |
| 4 | +level: "All" |
| 5 | +time: "18:00" |
| 6 | +rsvp_link: https://www.meetup.com/Python-Sprints/events/262426168/ |
| 7 | +project: |
| 8 | +sponsor: ecom |
| 9 | +--- |
| 10 | + |
| 11 | +Let's continue working on visualisation in `pandas`. |
| 12 | + |
| 13 | +Plotting in `pandas` is very easy, mainly by using `Series.plot()` and `DataFrame.plot()` methods. |
| 14 | +There is a plotting subsystem in `pandas` based in `matplotlib` that implement different types of |
| 15 | +plots (e.g. lines, bars, boxplots, kde...). |
| 16 | + |
| 17 | +In the last months, several new projects have been create to address new use cases for visualising |
| 18 | +in `pandas`. For example, to generate interactive plots. Some of these projects are: |
| 19 | + |
| 20 | +- https://hvplot.pyviz.org |
| 21 | +- https://github.com/PatrikHlobil/Pandas-Bokeh |
| 22 | +- https://github.com/altair-viz/pdvega/ |
| 23 | + |
| 24 | +Those libraries have been monkey patching `pandas` to be able to plot easily, so plotting can be |
| 25 | +done by using `DataFrame.hvplot()`, `DataFrame.plot_bokeh()`... |
| 26 | + |
| 27 | +But a better design would be to decouple the existing plotting code in pandas into an extension |
| 28 | +registered with the `pandas` extension capabilities, and be able to select with an option with |
| 29 | +plotting backend the user wants to use. The resulting code would be: |
| 30 | + |
| 31 | +```python |
| 32 | +pandas.set_option('plotting.backend', 'hvplot') |
| 33 | +df.plot() |
| 34 | +``` |
| 35 | + |
| 36 | +With this architecture, there are several advantages: |
| 37 | + |
| 38 | +- Developing new plotting backends for pandas becomes much simpler |
| 39 | +- Plotting backends share a common API |
| 40 | +- Users of pandas don't need to learn a new syntax for each plugin |
| 41 | +- Migrating existing code becomes trivial, by just adding a single line of code setting the option for the backend |
| 42 | +- Internal pandas code becomes cleaner, with the plotting code fully decoupled from the rest |
| 43 | + |
| 44 | +Work on this is already going on, with a first PR that decoupled the current plotting code: |
| 45 | + |
| 46 | +https://github.com/pandas-dev/pandas/pull/26414 |
| 47 | + |
| 48 | +In this sprint we will continue the work, by working on different tasks: |
| 49 | +- Defining and documenting the pandas plotting API |
| 50 | +- Porting [hvplot](https://hvplot.pyviz.org/) to the new plotting API |
| 51 | +- Improve pandas plotting documentation |
| 52 | +- Try to move plots like andrews_curves, lag_plot... to the "standard" `.plot(kind=X)` API |
| 53 | + |
| 54 | +We also can work on other pandas issues, for example: |
| 55 | +- pytest-azurepipelines: <https://github.com/pandas-dev/pandas/issues/26601> |
| 56 | +- Disable codecov commenting: <https://github.com/pandas-dev/pandas/issues/26896> |
| 57 | +- Implement web service to write GitHub comments with the CI results <https://github.com/pandas-dev/pandas/issues/26930> |
| 58 | +- Validate title capitalisation in the docs <https://github.com/pandas-dev/pandas/issues/26941> |
| 59 | +- Fix Azure pipelines problem with $PATH <https://github.com/pandas-dev/pandas/issues/26962> |
| 60 | +- Fix `pipe` example in the documentation <https://github.com/pandas-dev/pandas/issues/27054> |
| 61 | +- Bug in the validation of docstrings <https://github.com/pandas-dev/pandas/issues/27055> |
| 62 | +- Feel free to propose yours |
| 63 | + |
| 64 | +As usual, we will give priority to join the sprint to the next people: |
| 65 | + |
| 66 | +- Experienced open source contributors |
| 67 | +- People from underrepresented minorities in our sprints |
| 68 | + |
| 69 | +Agenda |
| 70 | +------ |
| 71 | + |
| 72 | +- 6:00pm: Food and networking |
| 73 | +- 6:30pm: Presentation of the project and the sponsor |
| 74 | +- 6:45pm: Coding |
| 75 | + |
| 76 | + |
| 77 | +The day of the sprint |
| 78 | +--------------------- |
| 79 | + |
| 80 | +- Bring your own laptop if you can |
| 81 | +- Join the [Gitter channel](https://gitter.im/py-sprints/pandas-bokeh) of the sprint |
| 82 | + |
| 83 | +Code of Conduct |
| 84 | +--------------- |
| 85 | + |
| 86 | +- Please be reminded that all participants are expected to follow the [NumFOCUS Code of Conduct](https://numfocus.org/code-of-conduct) |
0 commit comments