In [1]:
import numpy as np
import physt
%matplotlib inline
In [2]:
histogram = physt.h1(None, "fixed_width", bin_width=0.1, adaptive=True)
histogram
Out[2]:
In [3]:
# Big chunk of data
data1 = np.random.normal(0, 1, 10000000)
histogram.fill_n(data1)
histogram
Out[3]:
In [4]:
histogram.plot()
Out[4]:
Store the histogram:
In [5]:
histogram.to_json(path="./histogram.json");
del histogram
Turn off the machine, go for lunch, return home later...
Read the histogram:
In [6]:
histogram = physt.io.load_json(path="./histogram.json")
histogram
Out[6]:
In [7]:
histogram.plot()
Out[7]:
The same one ;-)
Continue filling:
In [8]:
# Another big chunk of data
data1 = np.random.normal(3, 2, 10000000)
histogram.fill_n(data1)
histogram
Out[8]:
In [9]:
histogram.plot()
Out[9]: