doc error in fromregex

http://docs.scipy.org/doc/numpy/reference/generated/numpy.fromregex.html#num... says 'str or file', but I don't think it takes str, only file name

The code contains if not hasattr(file, "read"): file = open(file,'r') so it should work. 2009/3/9 Neal Becker <ndbecker2@gmail.com>:
http://docs.scipy.org/doc/numpy/reference/generated/numpy.fromregex.html#num... says 'str or file', but I don't think it takes str, only file name

Stéfan van der Walt wrote:
The code contains
if not hasattr(file, "read"): file = open(file,'r')
so it should work.
2009/3/9 Neal Becker <ndbecker2@gmail.com>:
http://docs.scipy.org/doc/numpy/reference/generated/numpy.fromregex.html#num...
says 'str or file', but I don't think it takes str, only file name
Oh, so you mean pass a filename or an open file. I thought it meant it could read from a string.

2009/3/9 Neal Becker <ndbecker2@gmail.com>:
http://docs.scipy.org/doc/numpy/reference/generated/numpy.fromregex.html#num...
says 'str or file', but I don't think it takes str, only file name
Oh, so you mean pass a filename or an open file. I thought it meant it could read from a string.
Yes, the docs say: file : str or file File name or file object to read. Cheers Stéfan
participants (2)
-
Neal Becker
-
Stéfan van der Walt