Skip to main content

Interactively plot streaming sequences of numbers

Project description

carlo

Named after the Monte Carlo algorithm, this module displays interactive histograms of streaming/online data. It's meant for quickly visualizing distributions, and it'll keep refining its histogram as new data comes in.

Accepts lists, generators, numbers from stdin, or a function to be repeatdly evaluated. Displays data as histograms with automagic bin allocation, and extra statistics in legends.

Example 1

Compare samples from one 20-sided dice vs three 6-sided dices.

Imported:

from carlo import plot, d
plot(lambda: d(20), lambda: d(6)+d(6)+d(6))

Or as standalone module (where d(n) simulates the roll of a n-sided dice):

carlo "d(20)" "d(6)+d(6)+d(6)"

example screenshot showing two histograms superimposed

Example 2

Sample values from max(0.5, random()**0.2).

Imported:

from carlo import plot
from random import random
plot(lambda: max(0.5, random()**0.2))

Or as standalone module (all functions from the random module are automatically available).

carlo "max(0.5, random()**0.2)"

example screenshot showing a skewed-looking histogram

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carlo-0.1.9.tar.gz (7.7 kB view hashes)

Uploaded Source

Built Distribution

carlo-0.1.9-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page