[SciPy-Dev] stats._support.adm() dos not seem to like string values

josef.pktd@gmai... josef.pktd@gmai...
Fri Jul 2 16:22:45 CDT 2010


On Fri, Jul 2, 2010 at 3:25 PM, Vincent Davis <vincent@vincentdavis.net> wrote:
>>>> y
> array([['1', '2', 't'],
>       ['1', '3', '3']],
>      dtype='|S8')
>>>> s.adm(y, 'x[1]=='2'')
> Traceback (most recent call last):
>  File "<string>", line 1, in <fragment>
> invalid syntax: <string>, line 1, pos 18

That's invalid syntax in your string

>>> stats._support.adm(y, "x[1]=='2'")
array([['1', '2', 't']],
      dtype='|S8')

use single quote inside double quote or the other way around.

Josef


>
> The documentation is very lacking, My question is should the ability
> to handle string be added/fixed or should the docs specify numbers
> only.
>
> Also I think the criterion should be improved accept "x[1]" or in the
> above example "y[1]" really it could accept anything as the "x" has
> not real meaning in the criterion
>
> Suggestion/comments
>
> Vincent
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>


More information about the SciPy-Dev mailing list