Skip to content

Instantly share code, notes, and snippets.

View nyggus's full-sized avatar

Marcin Kozak nyggus

View GitHub Profile
import timeit
import pprint
import rounder # requires installation from PyPi
def compare(
__snippet1,
__snippet2,
*args,
number=10_000_000,
import timeit
import pprint
import rounder # requires installation from PyPi
def compare(
__snippet1,
__snippet2,
*args,
number=10_000_000,
>>> print(
... iris >>
... group_by('Species') >>
... head(n=5)
... )
groups: ['Species']
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
0 5.1 3.5 1.4 0.2 setosa
1 4.9 3.0 1.4 0.2 setosa
2 4.7 3.2 1.3 0.2 setosa
print(iris >> group_by('Species') >> head(n=5))
>>> iris = data('iris')
>>> iris.head()
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3.0 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5.0 3.6 1.4 0.2 setosa
>>> from statistics import mean, stdev
>>> from pydataset import data
>>> from plydata import define, group_by, head, query, select, summarize