3 ms·
Dplyr and data.table are two libraries that make R shine in terms of data manipulation. Python however has static analysis tools that are unavailable in R. I w
by javitury 6y ago
Dplyr and data.table are two libraries that make R shine in terms of data manipulation.
Python however has static analysis tools that are unavailable in R. I wonder if there is a data manipulation library in python that takes advantage of this. Looking at this library, it doesn't appear to use type hints. Other libraries, like pandas, have some basic support for typings but they are still far from being fully typed.
- unnah 6y agoDon't forget ggplot2, another shiny tidyverse product. It has also been ported to python: https://plotnine.readthedocs.io/en/stable/ https://plotnine.readthedocs.io/en/stable/
- closed 6y agoSiuba uses type hints to dispatch the appropriate versions of custom functions! For example, siuba allows users to create custom functions using a thin wrapper around functools.singledispatch. When deciding how to run... df >> filter(my_custom_func(_.x)) It requires that the return type be compatible with the backend being run (e.g. pandas, a SQL dialect). Would be super interesting to try and lay out what would be needed to do static analysis via mypy. I think it'd require some plugins for singledispatch at least, probably some reworking things in ways myoy expects. https://nbviewer.jupyter.org/github/machow/siuba/blob/master/examples/architecture/004-user-defined-functions.ipynb https://nbviewer.jupyter.org/github/machow/siuba/blob/master...