Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > NumPy and vectorize

Reply
Thread Tools

NumPy and vectorize

 
 
Carl Johan Rehn
Guest
Posts: n/a
 
      04-28-2010
I'm having problem with the return values of NumPy's vectorize
function. When I pass an array of strings in the following simple
example, vectorize truncates the strings in the returned list. Any
clues of what to do?

Yours, Carl


import numpy as np

def __f(x):
return x

f = vectorize(__f)

s = '2010-04-28'
y1 = f(s)
y2 = f(np.array([s, s, s, s]))

In [62]: y1
Out[62]:
array('2010-04-28',
dtype='|S10')

In [63]: y2
Out[63]:
array(['2010-04-', '2010-04-', '2010-04-', '2010-04-'],
dtype='|S8')
 
Reply With Quote
 
 
 
 
Robert Kern
Guest
Posts: n/a
 
      04-28-2010
On 4/28/10 1:48 PM, Carl Johan Rehn wrote:
> I'm having problem with the return values of NumPy's vectorize
> function. When I pass an array of strings in the following simple
> example, vectorize truncates the strings in the returned list. Any
> clues of what to do?


You will want to report numpy bugs to the numpy mailing list:

http://www.scipy.org/Mailing_Lists

--
Robert Kern

"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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing numpy over an older numpy Tom Kacvinsky Python 1 06-15-2012 07:15 PM
A More Concise Description of Numpy than the Guide to Numpy? W. eWatson Python 2 11-23-2009 08:58 PM
NumPy Question - numpy.put in multi-dimensional array Bryan.Fodness@gmail.com Python 2 11-13-2007 10:36 PM
numpy migration (also posted to numpy-discussion) Duncan Smith Python 3 04-25-2007 01:36 AM
Trouble with numpy-0.9.4 and numpy-0.9.5 drife Python 1 03-01-2006 05:59 PM



Advertisments