[Numpy-discussion] creating column vectors

Christopher Barker Chris.Barker at noaa.gov
Wed Feb 8 17:02:22 EST 2006


Sven Schreiber wrote:
>> Take a little time to get used to it, and you'll become very glad
>> that numpy works the way it does, rather than like Matlab.

> I bet you won't be very successful in
> the Gauss et al. camp with that marketing slogan...

It's not a marketing slogan. It's a suggestion for someone that has 
already decided to learn Python+Numpy.

Whenever you use something new, you shouldn't try to use it the same way 
that you use a different tool. We say the same thing to people that try 
to write Python like it's C.

> does not sound very pythonic; the "you'll get used to it, and trust me,
> even if you don't understand it now, it's great afterwards"-approach
> sounds more like the pre-python era (you may insert a language of your
> choice here ;-)

The difference is that you really will like it better, not just get used 
to it.

> I don't see why numpy cannot preserve the features that are important to
> you (and which I know nothing about) and at the same time make life more
> intuitive and easier for 2d-dummies like myself -- 

Because a matrix is not the same as an array. A matrix can be 
represented by a 2-d matrix, but a matrix can not represent an arbitrary 
n-d array (at  least not easily!). If you're really doing a lot of 
linear algebra, then you want to use the matrix package. I haven't used 
it, but it should have a way to easily create a column vector for you.

Python (and NumPy) is a much more powerful and flexible language than 
Matlab (Or gauss, or IDL, or...) Once you learn to use it, you will be 
happy you did. I was a major Matlab fan a while back. I spend 5 years in 
grad school using it, and did my entire dissertation with it. I've 
recently been helping a friend with some Matlab code, and I find it 
painful to use. You'll see.

Or was that too smug?

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the NumPy-Discussion mailing list