Re: [Tutor] Installing python and numpy on the Mac (OSX)

2018-01-13 Thread giacomo . boffi
Peter Hodges writes: > Hi. I downloaded Python 3.6 from the python site, then followed online > directions for pip to install numpy (in users? —user was in the > example). > When I start IDLE in the Python 3.6 in Applications and then type > import numpy as np I get the following: > import numpy

Re: [Tutor] Python 3.6 Multiply the elements of a 2D Array by the elements of a 1D Aeeay

2017-04-16 Thread giacomo . boffi
giacomo.bo...@gmail.com writes: I throw two errors in my answer, see the inline corrections > Possibility 1 > > c = np.outer(D, s) # c has shape (i*j, k) as outer flattens its arguments > c = sum(c, 1) # c has shape (i*j) because se summed over 2nd index c = np.sum(c, 1) # c has shape

Re: [Tutor] Python 3.6 Multiply the elements of a 2D Array by the elements of a 1D Aeeay

2017-04-16 Thread giacomo . boffi
"Stephen P. Molnar" writes: > I have an list generated by: s = np.linspace(start,finish,points) > > and an array D: > > [ 0. 2.0598013.60937686 3.32591826 2.81569212] > [ 2.0598010. 4.71452879 4.45776445 4.00467382] > [ 3.60937686 4.71452879 0. 5.6650