loading-data-from-files/script.rst
changeset 250 4d8ef03627b5
parent 248 0bad7228029c
child 384 525ae0d74e47
equal deleted inserted replaced
249:cad8e64dcd82 250:4d8ef03627b5
    79 about them, later.
    79 about them, later.
    80 
    80 
    81 Now, let us use the ``loadtxt`` command to read a file that contains
    81 Now, let us use the ``loadtxt`` command to read a file that contains
    82 two columns of data, ``pendulum.txt``. This file contains the length
    82 two columns of data, ``pendulum.txt``. This file contains the length
    83 of the pendulum in the first column and the corresponding time period
    83 of the pendulum in the first column and the corresponding time period
    84 in the second.
    84 in the second. Note that ``loadtxt`` needs both the columns to have
       
    85 equal number of rows. 
    85 
    86 
    86 .. Following is an exercise that you must do. 
    87 .. Following is an exercise that you must do. 
    87 
    88 
    88 .. %%1%% Use the ``cat`` command to view the contents of this file.
    89 .. %%1%% Use the ``cat`` command to view the contents of this file.
    89 
    90 
   137 
   138 
   138 {{{ show the slide with loadtxt --- other features }}}
   139 {{{ show the slide with loadtxt --- other features }}}
   139 
   140 
   140 In this tutorial, we have learnt the basic use of the ``loadtxt``
   141 In this tutorial, we have learnt the basic use of the ``loadtxt``
   141 command, which is capable of doing a lot more than we have used it for
   142 command, which is capable of doing a lot more than we have used it for
   142 until now, for example
   143 until now. Let us look at an example, but before that do this
   143 
   144 exercise. 
   144 Following is an exercise that you must do. 
       
   145 
   145 
   146 %%1%% Read the file ``pendulum_semicolon.txt`` which contains the same
   146 %%1%% Read the file ``pendulum_semicolon.txt`` which contains the same
   147 data as ``pendulum.txt``, but the columns are separated by semi-colons
   147 data as ``pendulum.txt``, but the columns are separated by semi-colons
   148 instead of spaces. Use the IPython help to see how to do this. 
   148 instead of spaces. Use the IPython help to see how to do this. 
   149 
   149