Mercurial > hg > medcouple
comparison talk/code/show_mc.py @ 68:5510ac95a3d3
last minute fixes
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Wed, 18 May 2016 18:06:22 -0400 |
parents | 1aa38f4846e0 |
children | 6b0f8b05c0c4 |
comparison
equal
deleted
inserted
replaced
67:1aa38f4846e0 | 68:5510ac95a3d3 |
---|---|
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 # GNU General Public License for more details. | 18 # GNU General Public License for more details. |
19 | 19 |
20 # You should have received a copy of the GNU General Public License | 20 # You should have received a copy of the GNU General Public License |
21 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 21 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 import sys |
23 | 23 |
24 import numpy as np | 24 import numpy as np |
25 | 25 |
26 from itertools import tee, izip | 26 from itertools import tee, izip |
27 | 27 |
259 else: | 259 else: |
260 return 0 | 260 return 0 |
261 | 261 |
262 | 262 |
263 def main(): | 263 def main(): |
264 data = np.random.uniform(size=26) | 264 if len(sys.argv) < 2: |
265 print "Need a size" | |
266 exit(1) | |
267 | |
268 data = np.random.uniform(size=int(sys.argv[1])) | |
265 | 269 |
266 mc = medcouple_1d(data) | 270 mc = medcouple_1d(data) |
267 with open("mc", "w") as f: | 271 with open("mc", "w") as f: |
268 f.write("%s\n" % mc) | 272 f.write("%s\n" % mc) |
269 | 273 |