Skip to content

amadev/doan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

doan - Simple library for analytics

Examples

Prepare files for analysis.

import numpy as np
norm = np.random.normal(0, 0.5, 1000)
np.savetxt('/tmp/doan-normal', norm)
rand = np.random.randint(0, 100, 1000)
np.savetxt('/tmp/doan-rand', rand)

There is a file with numbers, let’s try to calculate its mean.

from doan import r_num, mean
print(mean(r_num('/tmp/doan-normal')))

If we want to get more information about list then call stat. For normal distributed data.

from doan import r_num, stat
print(stat(r_num('/tmp/doan-normal')))

And for random sample.

from doan import r_num, stat
print(stat(r_num('/tmp/doan-rand')))

To visualize numeric data there is a hist function. For normal distributed data.

from doan import r_num, hist
return hist(r_num('/tmp/doan-normal'))

And for random sample.

from doan import r_num, hist
return hist(r_num('/tmp/doan-rand'))

Can work with ssh and shell.

from doan import cmd, r_num, percentiles
print(percentiles(r_num(cmd("awk '{print $1 - 1}' /tmp/example-file")), [0.95]))
from doan import ssh, r_num, percentiles
print(percentiles(r_num(ssh('log')('echo "1\n2\n3\n" > /tmp/example-file')), [0.95]))

About

Simple library for analytics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors