[Numpy-tickets] [NumPy] #331: Empty strings not allowed in adaptable string data types

NumPy numpy-tickets at scipy.net
Wed Oct 11 03:09:08 CDT 2006


#331: Empty strings not allowed in adaptable string data types
-------------------------+--------------------------------------------------
 Reporter:  faltet       |       Owner:  somebody
     Type:  enhancement  |      Status:  new     
 Priority:  normal       |   Milestone:          
Component:  Other        |     Version:          
 Severity:  normal       |    Keywords:          
-------------------------+--------------------------------------------------
 Why it is not possible to create arrays with adaptable size coming from
 empty strings?

 {{{
 In [27]:numpy.array("", dtype="S")
 ---------------------------------------------------------------------------
 exceptions.ValueError                                Traceback (most
 recent call last)

 /home/faltet/python.nobackup/numpy/<ipython console>

 ValueError: Empty data-type

 }}}

 I think that in this case it would be nice to allow this by returning a
 "S1" dtype (i.e. the minimum length that is able to keep an empty string).
 That would be the equivalent to:

 {{{
 In [29]:numpy.array("", dtype="S1")
 Out[29]:
 array('',
       dtype='|S1')

 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/331>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list