Hi, I need to know why the attached code works in one case and takes
forever to run in the other one.
I don't think I've done anything wrong and I tried everything that came
to my mind now.
If you use "x1 = mu + sigma * np.random.randn(1000)" instead of "x1 =
np.array([np.float64(val / 2.0) for val in x0], np.float64)"
Why doesn't this work if its the same array divided by 2 ?
Thanks,
Axel Gembe
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, codecs
#import matplotlib
#matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
mu, sigma = 75, 25
x0 = mu + sigma * np.random.randn(3000)
# First one works, second one doesn't, why?
#x1 = mu + sigma * np.random.randn(1000)
x1 = np.array([np.float64(val / 2.0) for val in x0], np.float64)
print '%r' % x0
print '%s' % type(x0).__name__
print '%r' % x1
print '%s' % type(x1).__name__
n, bins, patches = plt.hist((x0, x1), bins = 25, normed = False, histtype =
'bar')
sys.stdout.flush()
sys.stdout = codecs.open("test.png", "wb", None)
plt.savefig(sys.stdout, filetype='png')
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users