Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

Instead of this simplified-version of this file:

#!/usr/bin/env python
import numpy as np
import pylab as P


data = [x.rstrip().split("\t") for x in file(".data", "r").readlines()]
sdData = [float(x[1]) for x in data]
retData =[float(x[0]) for x in data]

# Calculating medians for estimating mean and sd
sdMed = sorted(sdData)[len(sdData)/2]
retMed= sorted(retData)[len(sdData)/2]


mu, sigma = retMed, sdMed
x = mu + sigma*P.randn(10000)

# the histogram of the data with histtype='step'
n, bins, patches = P.hist(x, 20, normed=1, histtype='stepfilled')
P.setp(patches, 'facecolor', 'g', 'alpha', 0.75)

# add a line showing the expected distribution
y = P.normpdf( bins, mu, sigma)
l = P.plot(bins, y, 'k--', linewidth=1.5)


#
# create a histogram by providing the bin edges (unequally spaced)
#
P.figure()
P.show()

is there something like this hist(SampleDataPoints)?

share|improve this question

1 Answer

up vote 1 down vote accepted

These demos look simpler.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.