python array


i have this code that i am trying to understand..

 np.subtract.outer(obs[:,0], interp[:,0])

even when i run the program..i dont understand.....
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I am guessing, that obs and interp are no standard python data types, but some
special class of a special library.

In order to verify my assumption:
could you add following line before this line in question and tell me what's printed out

print('type of obs = %r' % type(obs))
zizi21Author Commented:
I am trying to understand teh second code from here

It is self created array ...
OK. This code is heavily using numpy, with which I have unfortunately very little experience.

You see, that numpy is imported as np,
which means, that all functions like for example
np.vstack() are numpy functions.

so the line
obs = np.vstack((x0, y0)).T

creates some numpy object, which is not a standard array, but an object of the type
numpy.ndarray, which is an n-dimensional array and allows manipulations not supported by normal python arrays.

Please look at Numpy's documentation:

The third example explains the slicing syntax

y = x[:,1]

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zizi21Author Commented:
Thanks a lot
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.