Getting started with Scipy/NumPy

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tkpmep@hotmail.com

    #1

    Getting started with Scipy/NumPy

    I installed SciPy and NumPy (0.9.5, because 0.9.6 does not work with
    the current version of SciPy), and had some teething troubles. I looked
    around for help and observed that the tutorial is dated October 2004,
    and is not as thorough as Python's documentation. Is there an
    alternative source of information that lists all the functions and
    their usage?

    I tried using scipy.info to get information on the std function in the
    stats libary, and ran into the following problem.

    [color=blue][color=green][color=darkred]
    >>> x = [1, 2, 3, 4]
    >>> import scipy
    >>> scipy.std(x)[/color][/color][/color]
    1.2909944487358 056
    [color=blue][color=green][color=darkred]
    >>> scipy.info(std)[/color][/color][/color]

    Traceback (most recent call last):
    File "<pyshell#6 >", line 1, in -toplevel-
    scipy.info(std)
    NameError: name 'std' is not defined
    [color=blue][color=green][color=darkred]
    >>> scipy.info(stat s)[/color][/color][/color]

    Traceback (most recent call last):
    File "<pyshell#7 >", line 1, in -toplevel-
    scipy.info(stat s)
    NameError: name 'stats' is not defined
    [color=blue][color=green][color=darkred]
    >>> scipy.info(stat s.std)[/color][/color][/color]

    Traceback (most recent call last):
    File "<pyshell#1 1>", line 1, in -toplevel-
    scipy.info(stat s.std)
    NameError: name 'stats' is not defined



    However, If I redo the import as follows I can get help on std:[color=blue][color=green][color=darkred]
    >>> from scipy import *
    >>> info(std)[/color][/color][/color]
    std(a, axis=0, dtype=None)

    None[color=blue][color=green][color=darkred]
    >>>[/color][/color][/color]

    Question: why did it work this time and not on my first attempt?

    Thanks in advance

    Thomas Philips

  • Robert Kern

    #2
    Re: Getting started with Scipy/NumPy

    tkpmep@hotmail. com wrote:[color=blue]
    > I installed SciPy and NumPy (0.9.5, because 0.9.6 does not work with
    > the current version of SciPy), and had some teething troubles. I looked
    > around for help and observed that the tutorial is dated October 2004,
    > and is not as thorough as Python's documentation. Is there an
    > alternative source of information that lists all the functions and
    > their usage?[/color]


    [color=blue]
    > I tried using scipy.info to get information on the std function in the
    > stats libary, and ran into the following problem.
    >[color=green][color=darkred]
    >>>>x = [1, 2, 3, 4]
    >>>>import scipy
    >>>>scipy.std(x )[/color][/color]
    >
    > 1.2909944487358 056
    >[color=green][color=darkred]
    >>>>scipy.info( std)[/color][/color]
    >
    > Traceback (most recent call last):
    > File "<pyshell#6 >", line 1, in -toplevel-
    > scipy.info(std)
    > NameError: name 'std' is not defined[/color]

    You would need to do

    scipy.info(scip y.std)
    [color=blue][color=green][color=darkred]
    >>>>scipy.info( stats)[/color][/color]
    >
    > Traceback (most recent call last):
    > File "<pyshell#7 >", line 1, in -toplevel-
    > scipy.info(stat s)
    > NameError: name 'stats' is not defined
    >[color=green][color=darkred]
    >>>>scipy.info( stats.std)[/color][/color]
    >
    > Traceback (most recent call last):
    > File "<pyshell#1 1>", line 1, in -toplevel-
    > scipy.info(stat s.std)
    > NameError: name 'stats' is not defined
    >
    > However, If I redo the import as follows I can get help on std:
    >[color=green][color=darkred]
    >>>>from scipy import *
    >>>>info(std)[/color][/color]
    >
    > std(a, axis=0, dtype=None)
    >
    > None
    >
    > Question: why did it work this time and not on my first attempt?[/color]

    Because you did a different kind of import on the second attempt.

    --
    Robert Kern
    robert.kern@gma il.com

    "I have come to believe that the whole world is an enigma, a harmless enigma
    that is made terrible by our own mad attempt to interpret it as though it had
    an underlying truth."
    -- Umberto Eco

    Comment

    Working...