Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rest typo

  • Loading branch information...
commit ab7b90ada83797d3d267c437c37148c2b13c900b 1 parent a9a237d
@jarrodmillman jarrodmillman authored
Showing with 58 additions and 57 deletions.
  1. +1 −0  TOCHANGE.txt
  2. +57 −57 scipy/io/examples/read_array_demo1.py
View
1  TOCHANGE.txt
@@ -40,6 +40,7 @@ Documentation
-------------
See http://projects.scipy.org/scipy/numpy/wiki/CodingStyleGuidelines
+
* use new docstring format
View
114 scipy/io/examples/read_array_demo1.py
@@ -1,58 +1,58 @@
-#=========================================================================
-# NAME: read_array_demo1
-#
-# DESCRIPTION: Examples to read 2 columns from a multicolumn ascii text
-# file, skipping the first line of header. First example reads into
-# 2 separate arrays. Second example reads into a single array. Data are
-# then plotted.
-#
-# Here is the format of the file test.txt:
-# --------
-# Some header to skip
-# 1 2 3
-# 2 4 6
-# 3 6 9
-# 4 8 12
-#
-# USAGE:
-# python read_array_demo1.py
-#
-# PARAMETERS:
-#
-# DEPENDENCIES:
-# matplotlib (pylab)
-# test.txt
-#
-#
-# AUTHOR: Simon J. Hook
-# DATE : 09/23/2005
-#
-# MODIFICATION HISTORY:
-#
-# COMMENT:
-#
-#============================================================================
-
-from scipy import *
-from scipy.io import read_array
-from pylab import *
-
-def main():
-
- # First example, read first and second column from ascii file. Skip first
- # line of header.
- # Note use of (1,-1) in lines to skip first line and then read to end of file
- # Note use of (0,) in columns to pick first column, since its a tuple need trailing comma
- x=read_array("test.txt",lines=(1,-1), columns=(0,))
- y=read_array("test.txt",lines=(1,-1), columns=(1,))
-
- #Second example, read the file into a single arry
- z=read_array("test.txt",lines=(1,-1), columns=(0,2))
-
- # Plot the data
- plot(x,y,'r--',z[:,0],z[:,1])
- show()
-
-# The one and only main function
-if __name__ == "__main__":
+#=========================================================================
+# NAME: read_array_demo1
+#
+# DESCRIPTION: Examples to read 2 columns from a multicolumn ascii text
+# file, skipping the first line of header. First example reads into
+# 2 separate arrays. Second example reads into a single array. Data are
+# then plotted.
+#
+# Here is the format of the file test.txt:
+# --------
+# Some header to skip
+# 1 2 3
+# 2 4 6
+# 3 6 9
+# 4 8 12
+#
+# USAGE:
+# python read_array_demo1.py
+#
+# PARAMETERS:
+#
+# DEPENDENCIES:
+# matplotlib (pylab)
+# test.txt
+#
+#
+# AUTHOR: Simon J. Hook
+# DATE : 09/23/2005
+#
+# MODIFICATION HISTORY:
+#
+# COMMENT:
+#
+#============================================================================
+
+from scipy import *
+from scipy.io import read_array
+from pylab import *
+
+def main():
+
+ # First example, read first and second column from ascii file. Skip first
+ # line of header.
+ # Note use of (1,-1) in lines to skip first line and then read to end of file
+ # Note use of (0,) in columns to pick first column, since its a tuple need trailing comma
+ x=read_array("test.txt",lines=(1,-1), columns=(0,))
+ y=read_array("test.txt",lines=(1,-1), columns=(1,))
+
+ #Second example, read the file into a single arry
+ z=read_array("test.txt",lines=(1,-1), columns=(0,2))
+
+ # Plot the data
+ plot(x,y,'r--',z[:,0],z[:,1])
+ show()
+
+# The one and only main function
+if __name__ == "__main__":
main()
Please sign in to comment.
Something went wrong with that request. Please try again.