[Scipy-svn] r3074 - in trunk/Lib/sandbox/pyem/data: . oldfaithful oldfaithful/src

scipy-svn@scip... scipy-svn@scip...
Thu Jun 7 21:36:20 CDT 2007


Author: cdavid
Date: 2007-06-07 21:36:11 -0500 (Thu, 07 Jun 2007)
New Revision: 3074

Added:
   trunk/Lib/sandbox/pyem/data/oldfaithful/
   trunk/Lib/sandbox/pyem/data/oldfaithful/README
   trunk/Lib/sandbox/pyem/data/oldfaithful/__init__.py
   trunk/Lib/sandbox/pyem/data/oldfaithful/data.py
   trunk/Lib/sandbox/pyem/data/oldfaithful/oldfaithful.py
   trunk/Lib/sandbox/pyem/data/oldfaithful/src/
   trunk/Lib/sandbox/pyem/data/oldfaithful/src/Oldfaithful.txt
   trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC1.txt
   trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC2.txt
   trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC3.txt
   trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC4.txt
   trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC5.txt
   trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC6.txt
   trunk/Lib/sandbox/pyem/data/oldfaithful/src/convert.py
Log:
Add faithful data in data. 

Added: trunk/Lib/sandbox/pyem/data/oldfaithful/README
===================================================================
--- trunk/Lib/sandbox/pyem/data/oldfaithful/README	2007-06-08 02:25:02 UTC (rev 3073)
+++ trunk/Lib/sandbox/pyem/data/oldfaithful/README	2007-06-08 02:36:11 UTC (rev 3074)
@@ -0,0 +1,6 @@
+Each OldfaithfulC*.txt is one column of the datasets as presented in Azzalini
+and Bowman. The Oldfaithful.txt is simply a cat of all thos files: this is just
+to make checking easier. The data in the txt are *exactly* the same than the
+ones in Azzalini and Bowman: again, post processing them in python is easy
+(converting the time in seconds, etc...), and having exactly the data of the
+reference makes it easier to check.

Added: trunk/Lib/sandbox/pyem/data/oldfaithful/__init__.py
===================================================================
--- trunk/Lib/sandbox/pyem/data/oldfaithful/__init__.py	2007-06-08 02:25:02 UTC (rev 3073)
+++ trunk/Lib/sandbox/pyem/data/oldfaithful/__init__.py	2007-06-08 02:36:11 UTC (rev 3074)
@@ -0,0 +1,8 @@
+#! /usr/bin/env python
+# Last Change: Wed Apr 25 06:00 PM 2007 J
+import faith as _faith
+__doc__     = _faith.DESCRSHORT
+copyright   = _faith.COPYRIGHT
+source      = _faith.SOURCE
+
+load        = _faith.load

Added: trunk/Lib/sandbox/pyem/data/oldfaithful/data.py
===================================================================
--- trunk/Lib/sandbox/pyem/data/oldfaithful/data.py	2007-06-08 02:25:02 UTC (rev 3073)
+++ trunk/Lib/sandbox/pyem/data/oldfaithful/data.py	2007-06-08 02:36:11 UTC (rev 3074)
@@ -0,0 +1,94 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# Copyright (C) 2007 David Cournapeau <cournape@gmail.com>
+
+# The code and descriptive text is copyrighted and offered under the terms of
+# the BSD License from the authors; see below. However, the actual dataset may
+# have a different origin and intellectual property status. See the SOURCE and
+# COPYRIGHT variables for this information.
+
+# Copyright (c) 2007 David Cournapeau <cournape@gmail.com>
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the author nor the names of any contributors may be used
+#       to endorse or promote products derived from this software without
+#       specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Last Change: Fri Jun 08 11:00 AM 2007 J
+
+"""Old faithful dataset."""
+
+__docformat__ = 'restructuredtext'
+
+COPYRIGHT   = """See SOURCE. Pr Azzalini has explicitely given his consent for
+the use of those data in scipy."""
+TITLE       = "Old Faithful Geyser Data"
+SOURCE      = """AZZALINI A., BOWMAN A. W. (1990).  A look at some data on the
+Old Faithful Geyser.  Applied Statistics (Journal of the Royal Statistical
+Society series C), vol. 39, pp. 357-365. Data collected by the Yellowstone Park
+geologist, R. A. Hutchinson.
+
+References: 
+    - Härdle, W. (1991) Smoothing Techniques with Implementation in S.  New
+    York: Springer.
+    - Azzalini, A. and Bowman, A. W. (1990).  A look at some data on the Old
+Faithful geyser. Applied Statistics, 39, 357--365.
+
+Those data are exactly the ones from Azzalini and Bowman's article."""
+
+DESCRSHORT  = """Waiting time between eruptions and the duration of the
+eruption for the Old Faithful geyser in Yellowstone National Park, Wyoming,
+USA. Waiting times and duration time are in seconds"""
+
+DESCRLONG   = """According to Azzalini and Bowman's article, those data
+were recorded continuously from 1th August to 15th August 1985.
+
+Some of the durations times are labelled as L, M or S (Large, Small, Medium).
+According to Azzalini and Bowman's paper: "because the unbroken sequence
+required measurements to be taken at night, some duration times are recorded as
+L (long), S (short) and M (medium). Other data sets do not contain a con-
+tinuous stream of data, making it difficult to deal with time series features."
+"""
+
+NOTE        = """Eruptions time in seconds, waiting time to next eruption (in
+seconds)"""
+
+def load():
+    """load the actual data and returns them.
+    
+    :returns:
+        data: recordarray
+            a record array of the data.
+    """
+    import numpy
+    from oldfaithful import waiting, duration
+    assert len(waiting) == len(duration) == 299
+    data    = numpy.empty(len(waiting), \
+            [('duration', '|S5'), ('waiting', 'int')])
+    data['waiting']    = waiting
+    data['duration']   = duration
+    return data

Added: trunk/Lib/sandbox/pyem/data/oldfaithful/oldfaithful.py
===================================================================
--- trunk/Lib/sandbox/pyem/data/oldfaithful/oldfaithful.py	2007-06-08 02:25:02 UTC (rev 3073)
+++ trunk/Lib/sandbox/pyem/data/oldfaithful/oldfaithful.py	2007-06-08 02:36:11 UTC (rev 3074)
@@ -0,0 +1,54 @@
+duration =  [ '241', '129', 'L', 'L', 'L', 'S', '263', '257', '122', '290',
+        '110', '327', '97', '292', '263', '106', '280', 'S', '284', '253',
+        '114', '298', 'S', 'L', 'S', 'L', '170', '270', '244', '223', '211',
+        '268', '133', '293', '156', '249', '132', '286', '110', '276', '136',
+        '248', 'S', 'L', 'S', 'L', '113', '256', '125', '268', '133', '240',
+        '106', '260', '131', '269', '233', '200', '224', '240', '117', '316',
+        'S', 'L', 'S', 'L', 'S', 'L', '212', '130', '270', '121', '249', '252',
+        '260', '116', '279', '229', '242', '250', '280', '109', 'L', 'M', 'L',
+        'S', '267', '123', '255', '115', '280', '104', '263', '106', '276',
+        '112', '267', '98', '302', '109', '306', '98', '257', 'S', 'L', 'S',
+        '272', '120', 'L', '176', '284', '234', '117', '247', '108', '280',
+        '110', '282', '127', '287', '109', '246', '279', 'L', 'S', 'L', 'L',
+        '253', '248', '236', '225', '265', '148', '250', '228', '259', '232',
+        '281', '102', '298', '256', '275', 'L', 'L', 'L', 'L', '119', '276',
+        '50', '295', '104', '275', '102', '285', '110', '270', '112', '267',
+        '267', '240', '288', 'L', 'L', 'S', 'L', '116', '275', '120', '222',
+        '172', '290', '207', '263', '108', '264', '149', '271', '126', '261',
+        '262', '107', '295', '109', 'L', 'L', 'L', '232', '111', '282', '121',
+        '268', '112', '250', '114', '255', '195', '253', '113', '299', '111',
+        '240', '118', '286', 'L', 'S', 'L', 'L', '143', '265', '253', '262',
+        '120', '267', '105', '270', '97', '282', '154', '222', '254', '116',
+        '261', 'L', 'L', 'L', '253', '240', '248', '113', '268', '117', '253',
+        '103', '267', '255', '238', '263', '118', '267', '256', '115', '265',
+        'M', 'L', 'S', 'L', '197', '110', '277', '110', '277', '276', '255',
+        '116', '299', '118', '258', '252', '272', '264', '277', 'S', 'L', 'L',
+        '235', 'S', '270', '108', '240', '165', '284', '238', '117', '298',
+        '111', '288', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'S', 'L', '116',
+        '260', '100', '286', '117', '281', '116', '265', '128', '245', '124',
+        'L', 'L', 'S']
+waiting =  [ 4800, 4260, 3420, 4800, 4500, 4620, 3600, 5160, 4620, 3360, 4860,
+        3000, 5340, 3240, 5400, 4380, 3600, 4980, 3900, 4920, 5040, 3240, 5100,
+        3480, 4740, 3420, 5280, 4080, 4560, 4680, 4440, 5100, 4500, 3900, 4560,
+        3480, 5460, 3000, 5220, 2880, 5580, 3240, 5160, 3180, 4680, 3120, 4980,
+        3600, 5220, 2940, 4800, 3600, 5520, 2580, 5340, 3600, 5040, 4140, 4440,
+        4260, 6480, 3000, 4620, 3420, 4800, 3660, 4920, 2880, 4860, 4380, 3720,
+        4740, 3240, 4800, 4380, 4860, 3720, 4860, 4260, 4740, 4860, 4440, 3540,
+        4860, 3960, 5220, 3180, 4800, 3000, 5220, 3060, 4920, 3480, 4860, 2940,
+        5520, 3000, 5280, 3720, 5580, 3360, 5340, 3060, 4740, 3480, 4920, 3120,
+        5280, 3120, 4680, 4140, 4500, 4620, 3180, 4800, 3300, 5220, 3180, 5100,
+        3660, 5580, 3240, 4560, 4800, 4860, 3540, 5160, 4680, 4260, 4620, 4560,
+        5640, 4500, 3000, 4980, 4920, 4320, 4620, 4500, 3900, 4740, 4320, 4680,
+        4620, 4740, 4500, 4680, 3840, 4800, 2940, 5280, 3240, 5100, 3060, 5760,
+        3000, 4800, 4680, 4860, 4320, 4500, 4680, 5220, 4140, 3300, 4980, 2940,
+        4920, 3420, 5040, 3420, 5040, 4380, 4680, 3420, 4740, 3420, 5400, 3720,
+        5220, 4680, 3120, 5880, 2880, 4680, 4740, 3900, 5040, 3000, 4980, 3600,
+        4800, 3000, 5280, 3000, 5040, 4440, 4560, 3900, 5340, 2940, 5280, 3060,
+        4680, 5100, 3900, 4500, 4620, 4140, 5520, 4080, 5220, 3660, 4860, 3300,
+        5580, 3180, 5040, 4200, 4380, 5580, 3000, 5220, 4620, 4440, 4320, 4920,
+        4440, 4800, 2940, 5460, 3180, 5160, 2940, 4740, 5340, 5220, 4560, 3540,
+        4800, 5340, 2700, 5580, 4320, 4260, 3240, 4740, 4440, 3900, 4680, 3420,
+        5220, 4320, 5040, 2820, 5040, 3420, 5220, 4080, 5160, 4500, 4380, 3180,
+        4920, 5580, 4620, 3240, 5760, 2880, 5340, 3780, 5040, 4560, 3720, 4980,
+        3000, 5100, 4680, 4680, 4860, 4680, 4560, 4440, 4860, 3960, 5040, 2880,
+        5580, 2820, 5220, 3060, 4680, 3240, 5220, 3120, 5100, 3480, 5280, 4740]

Added: trunk/Lib/sandbox/pyem/data/oldfaithful/src/Oldfaithful.txt
===================================================================
--- trunk/Lib/sandbox/pyem/data/oldfaithful/src/Oldfaithful.txt	2007-06-08 02:25:02 UTC (rev 3073)
+++ trunk/Lib/sandbox/pyem/data/oldfaithful/src/Oldfaithful.txt	2007-06-08 02:36:11 UTC (rev 3074)
@@ -0,0 +1,299 @@
+4:01,80
+2:09 ,71
+L,57
+L,80
+L,75
+S,77
+4:23,60
+4:17,86
+2:02,77
+4:50,56
+1:50,81
+5:27,50
+1:37,89
+4:52,54
+4:23,90
+1:46,73
+4:40,60
+S,83
+4:44,65
+4:13,82
+1:54,84
+4:58,54
+S,85
+L,58
+S,79
+L,57
+2:50,88
+4:30,68
+4:04,76
+3:43,78
+3:31,74
+4:28,85
+2:13,75
+4:53,65
+2:36,76
+4:09,58
+2:12 ,91
+4:46,50
+1:50,87
+4:36,48
+2:16,93
+4:08,54
+S,86
+L,53
+S,78
+L,52
+1:53,83
+4:16,60
+2:05,87
+4:28,49
+2:13,80
+4:00,60
+1:46,92
+4:20,43
+2:11,89
+4:29,60
+3:53,84
+3:20,69
+3:44,74
+4:00,71
+1:57,108
+5:16,50
+S,77
+L,57
+S,80
+L,61
+S,82
+L,48
+3:32,81
+2:10,73
+4:30,62
+2:01,79
+4:09,54
+4:12,80
+4:20,73
+1:56,81
+4:39,62
+3:49,81
+4:02,71
+4:10,79
+4:40,81
+1:49,74
+L,59
+M,81
+L,66
+S,87
+4:27,53
+2:03,80
+4:15,50
+1:55,87
+4:40,51
+1:44,82
+4:23,58
+1:46,81
+4:36,49
+1:52,92
+4:27,50
+1:38,88
+5:02,62
+1:49,93
+5:06,56
+1:38,89
+4:17,51
+S,79
+L,58
+S,82
+4:32,52
+2:00,88
+L,52
+2:56,78
+4:44,69
+3:54,75
+1:57,77
+4:07,53
+1:48,80
+4:40,55
+1:50,87
+4:42,53
+2:07,85
+4:47,61
+1:49,93
+4:06,54
+4:39,76
+L,80
+S,81
+L,59
+L,86
+4:13,78
+4:08,71
+3:56,77
+3:45,76
+4:25,94
+2:28,75
+4:10,50
+3:48,83
+4:19,82
+3:52,72
+4:41,77
+1:42,75
+4:58,65
+4:16,79
+4:35,72
+L,78
+L,77
+L,79
+L,75
+1:59,78
+4:36,64
+0:50,80
+4:55,49
+1:44,88
+4:35,54
+1:42,85
+4:45,51
+1:50,96
+4:30,50
+1:52,80
+4:27,78
+4:27,81
+4:00,72
+4:48,75
+L,78
+L,87
+S,69
+L,55
+1:56,83
+4:35,49
+2:00,82
+3:42,57
+2:52,84
+4:50,57
+3:27,84
+4:23,73
+1:48,78
+4:24,57
+2:29,79
+4:31,57
+2:06,90
+4:21,62
+4:22,87
+1:47,78
+4:55,52
+1:49,98
+L,48
+L,78
+L,79
+3:52,65
+1:51,84
+4:42,50
+2:01,83
+4:28,60
+1:52,80
+4:10,50
+1:54,88
+4:15,50
+3:15,84
+4:13,74
+1:53,76
+4:59,65
+1:51,89
+4:00,49
+1:58,88
+4:46,51
+L,78
+S,85
+L,65
+L,75
+2:23,77
+4:25,69
+4:13,92
+4:22,68
+2:00,87
+4:27,61
+1:45,81
+4:30,55
+1:37,93
+4:42,53
+2:34,84
+3:42,70
+4:14,73
+1:56,93
+4:21,50
+L,87
+L,77
+L,74
+4:13,72
+4:00,82
+4:08,74
+1:53,80
+4:28,49
+1:57,91
+4:13,53
+1:43,86
+4:27,49
+4:15,79
+3:58,89
+4:23,87
+1:58,76
+4:27,59
+4:16,80
+1:55,89
+4:25,45
+M,93
+L,72
+S,71
+L,54
+3:17,79
+1:50,74
+4:37,65
+1:50,78
+4:37,57
+4:36,87
+4:15,72
+1:56,84
+4:59,47
+1:58,84
+4:18,57
+4:12,87
+4:32,68
+4:24,86
+4:37,75
+S,73
+L,53
+L,82
+3:55,93
+S,77
+4:30,54
+1:48,96
+4:00,48
+2:45,89
+4:44,63
+3:58,84
+1:57,76
+4:58,62
+1:51,83
+4:48,50
+L,85
+L,78
+L,78
+L,81
+L,78
+L,76
+L,74
+S,81
+L,66
+1:56,84
+4:20,48
+1:40,93
+4:46,47
+1:57,87
+4:41,51
+1:56,78
+4:25,54
+2:08,87
+4:05,52
+2:04,85
+L,58
+L,88
+S,79

Added: trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC1.txt
===================================================================
--- trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC1.txt	2007-06-08 02:25:02 UTC (rev 3073)
+++ trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC1.txt	2007-06-08 02:36:11 UTC (rev 3074)
@@ -0,0 +1,50 @@
+4:01,80
+2:09 ,71
+L,57
+L,80
+L,75
+S,77
+4:23,60
+4:17,86
+2:02,77
+4:50,56
+1:50,81
+5:27,50
+1:37,89
+4:52,54
+4:23,90
+1:46,73
+4:40,60
+S,83
+4:44,65
+4:13,82
+1:54,84
+4:58,54
+S,85
+L,58
+S,79
+L,57
+2:50,88
+4:30,68
+4:04,76
+3:43,78
+3:31,74
+4:28,85
+2:13,75
+4:53,65
+2:36,76
+4:09,58
+2:12 ,91
+4:46,50
+1:50,87
+4:36,48
+2:16,93
+4:08,54
+S,86
+L,53
+S,78
+L,52
+1:53,83
+4:16,60
+2:05,87
+4:28,49

Added: trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC2.txt
===================================================================
--- trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC2.txt	2007-06-08 02:25:02 UTC (rev 3073)
+++ trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC2.txt	2007-06-08 02:36:11 UTC (rev 3074)
@@ -0,0 +1,50 @@
+2:13,80
+4:00,60
+1:46,92
+4:20,43
+2:11,89
+4:29,60
+3:53,84
+3:20,69
+3:44,74
+4:00,71
+1:57,108
+5:16,50
+S,77
+L,57
+S,80
+L,61
+S,82
+L,48
+3:32,81
+2:10,73
+4:30,62
+2:01,79
+4:09,54
+4:12,80
+4:20,73
+1:56,81
+4:39,62
+3:49,81
+4:02,71
+4:10,79
+4:40,81
+1:49,74
+L,59
+M,81
+L,66
+S,87
+4:27,53
+2:03,80
+4:15,50
+1:55,87
+4:40,51
+1:44,82
+4:23,58
+1:46,81
+4:36,49
+1:52,92
+4:27,50
+1:38,88
+5:02,62
+1:49,93

Added: trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC3.txt
===================================================================
--- trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC3.txt	2007-06-08 02:25:02 UTC (rev 3073)
+++ trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC3.txt	2007-06-08 02:36:11 UTC (rev 3074)
@@ -0,0 +1,50 @@
+5:06,56
+1:38,89
+4:17,51
+S,79
+L,58
+S,82
+4:32,52
+2:00,88
+L,52
+2:56,78
+4:44,69
+3:54,75
+1:57,77
+4:07,53
+1:48,80
+4:40,55
+1:50,87
+4:42,53
+2:07,85
+4:47,61
+1:49,93
+4:06,54
+4:39,76
+L,80
+S,81
+L,59
+L,86
+4:13,78
+4:08,71
+3:56,77
+3:45,76
+4:25,94
+2:28,75
+4:10,50
+3:48,83
+4:19,82
+3:52,72
+4:41,77
+1:42,75
+4:58,65
+4:16,79
+4:35,72
+L,78
+L,77
+L,79
+L,75
+1:59,78
+4:36,64
+0:50,80
+4:55,49

Added: trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC4.txt
===================================================================
--- trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC4.txt	2007-06-08 02:25:02 UTC (rev 3073)
+++ trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC4.txt	2007-06-08 02:36:11 UTC (rev 3074)
@@ -0,0 +1,50 @@
+1:44,88
+4:35,54
+1:42,85
+4:45,51
+1:50,96
+4:30,50
+1:52,80
+4:27,78
+4:27,81
+4:00,72
+4:48,75
+L,78
+L,87
+S,69
+L,55
+1:56,83
+4:35,49
+2:00,82
+3:42,57
+2:52,84
+4:50,57
+3:27,84
+4:23,73
+1:48,78
+4:24,57
+2:29,79
+4:31,57
+2:06,90
+4:21,62
+4:22,87
+1:47,78
+4:55,52
+1:49,98
+L,48
+L,78
+L,79
+3:52,65
+1:51,84
+4:42,50
+2:01,83
+4:28,60
+1:52,80
+4:10,50
+1:54,88
+4:15,50
+3:15,84
+4:13,74
+1:53,76
+4:59,65
+1:51,89

Added: trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC5.txt
===================================================================
--- trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC5.txt	2007-06-08 02:25:02 UTC (rev 3073)
+++ trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC5.txt	2007-06-08 02:36:11 UTC (rev 3074)
@@ -0,0 +1,50 @@
+4:00,49
+1:58,88
+4:46,51
+L,78
+S,85
+L,65
+L,75
+2:23,77
+4:25,69
+4:13,92
+4:22,68
+2:00,87
+4:27,61
+1:45,81
+4:30,55
+1:37,93
+4:42,53
+2:34,84
+3:42,70
+4:14,73
+1:56,93
+4:21,50
+L,87
+L,77
+L,74
+4:13,72
+4:00,82
+4:08,74
+1:53,80
+4:28,49
+1:57,91
+4:13,53
+1:43,86
+4:27,49
+4:15,79
+3:58,89
+4:23,87
+1:58,76
+4:27,59
+4:16,80
+1:55,89
+4:25,45
+M,93
+L,72
+S,71
+L,54
+3:17,79
+1:50,74
+4:37,65
+1:50,78

Added: trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC6.txt
===================================================================
--- trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC6.txt	2007-06-08 02:25:02 UTC (rev 3073)
+++ trunk/Lib/sandbox/pyem/data/oldfaithful/src/OldfaithfulC6.txt	2007-06-08 02:36:11 UTC (rev 3074)
@@ -0,0 +1,49 @@
+4:37,57
+4:36,87
+4:15,72
+1:56,84
+4:59,47
+1:58,84
+4:18,57
+4:12,87
+4:32,68
+4:24,86
+4:37,75
+S,73
+L,53
+L,82
+3:55,93
+S,77
+4:30,54
+1:48,96
+4:00,48
+2:45,89
+4:44,63
+3:58,84
+1:57,76
+4:58,62
+1:51,83
+4:48,50
+L,85
+L,78
+L,78
+L,81
+L,78
+L,76
+L,74
+S,81
+L,66
+1:56,84
+4:20,48
+1:40,93
+4:46,47
+1:57,87
+4:41,51
+1:56,78
+4:25,54
+2:08,87
+4:05,52
+2:04,85
+L,58
+L,88
+S,79

Added: trunk/Lib/sandbox/pyem/data/oldfaithful/src/convert.py
===================================================================
--- trunk/Lib/sandbox/pyem/data/oldfaithful/src/convert.py	2007-06-08 02:25:02 UTC (rev 3073)
+++ trunk/Lib/sandbox/pyem/data/oldfaithful/src/convert.py	2007-06-08 02:36:11 UTC (rev 3074)
@@ -0,0 +1,43 @@
+#! /usr/bin/env python
+# Last Change: Fri Jun 08 11:00 AM 2007 J
+
+# This script generates a python file from the txt data
+import csv
+
+dataname = 'Oldfaithful.txt'
+f = open(dataname, 'r')
+a = csv.reader(f)
+el = [i for i in a]
+duration = [i[0] for i in el]
+waiting = [i[1] for i in el]
+
+# Convert duration and waiting times in second
+duration2 = []
+for i in range(len(duration)):
+	if duration[i] == 'L':
+		duration2.append('L')
+	elif duration[i] == 'M':
+		duration2.append('M')
+	elif duration[i] == 'S':
+		duration2.append('S')
+	else:
+		m, s = duration[i].split(':')
+		m = int(m)
+		s = int(s)
+		assert s >= 0 and s < 60
+		duration2.append(m * 60 + s)
+waiting2 = [int(i) * 60 for i in waiting]
+
+# Write the data in oldfaitful.py
+a = open("oldfaithful.py", "w")
+
+a.write("duration =  [\n")
+for i in range(len(duration2) - 1):
+	a.write("'%s', " % duration2[i])
+a.write("'%s']\n" % duration2[-1])
+
+a.write("waiting =  [\n")
+for i in range(len(waiting2) - 1):
+	a.write("%s, " % waiting2[i])
+a.write("%s]\n" % waiting2[-1])
+a.close()


Property changes on: trunk/Lib/sandbox/pyem/data/oldfaithful/src/convert.py
___________________________________________________________________
Name: svn:executable
   + *



More information about the Scipy-svn mailing list