INNER CODE UNIT · Python
lbpdf
mszell/geospatialdatascience · unit11_mobilityindividual/stats_utils.py:132
def lbpdf(binsize, input, out='no'):
"""
Return the probability density function of "input"
using logarithmic bins of size "binsize"
Input format: one column of numbers
Example:
---------
a, m = 0.5, 1.
data = np.random.pareto(a, 1000) + m
xy = lbpdf(1.5, data)
"""
# Detect input type:
if input == sys.stdin:
# the data come form standard input
d = [ list_check(map(float,l.split())) for l in sys.stdin ]
# d = [ float(l) for l in sys.stdin if l.strip() ]