-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
datar does not only mimic the piping syntax, but follows the API design from dplyr as much as possible, and is tested with its test cases.
from datar import f from datar.dplyr import mutate, filter, if_else from datar.tibble import tibble # or # from datar.all import f, mutate, filter, if_else, tibble df = tibble( x=range(4), y=['zero', 'one', 'two', 'three'] ) df >> mutate(z=f.x) """# output x y z 0 0 zero 0 1 1 one 1 2 2 two 2 3 3 three 3 """ df >> mutate(z=if_else(f.x>1, 1, 0)) """# output: x y z 0 0 zero 0 1 1 one 0 2 2 two 1 3 3 three 1 """ df >> filter(f.x>1) """# output: x y 0 2 two 1 3 three """ df >> mutate(z=if_else(f.x>1, 1, 0)) >> filter(f.z==1) """# output: x y z 0 2 two 1 1 3 three 1 """ Works with plotnine # example grabbed from https://github.com/has2k1/plydata import numpy from datar.base import sin, pi from plotnine import ggplot, aes, geom_line, theme_classic df = tibble(x=numpy.linspace(0, 2*pi, 500)) (df >> mutate(y=sin(f.x), sign=if_else(f.y>=0, "positive", "negative")) >> ggplot(aes(x='x', y='y')) + theme_classic() + geom_line(aes(color='sign'), size=1.2)) https://preview.redd.it/w0hs4m8fyf771.png?width=697&format=png&auto=webp&s=eadd7473a9e3393c2d58531c0b2b12f849c27e5e Easy to integrate with other libraries import klib from pipda import register_verb from datar.datasets import iris from datar.dplyr import pull dist_plot = register_verb(func=klib.dist_plot) iris >> pull(f.Sepal_Length) >> dist_plot() https://preview.redd.it/w8b8ouagyf771.png?width=892&format=png&auto=webp&s=3cc8f04e63be710f593b2b6128073f65cf7ffaa4 For more detailed and advanced usage, see https://pwwang.github.io/datar/
I wrote a framework (https://github.com/pwwang/pipda) that fits this situation, and it makes me easier to port those APIs as they are in python. I am not only following the documentation of the original APIs but looking into the R source code of them so that I can recover most parts of them. I wouldn't say it's perfect, due to the difference between the languages, but I would say it the closest and most covered port of dplyr/tidyr and related packages in python.