This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from statistics import mean, stdev | |
>>> from pydataset import data | |
>>> from plydata import define, group_by, head, query, select, summarize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(iris >> group_by('Species') >> head(n=5)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
import pprint | |
import rounder # requires installation from PyPi | |
def compare( | |
__snippet1, | |
__snippet2, | |
*args, | |
number=10_000_000, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
import pprint | |
import rounder # requires installation from PyPi | |
def compare( | |
__snippet1, | |
__snippet2, | |
*args, | |
number=10_000_000, |