Re: Difference between array( [1,0,1] ) and array( [ [1,0,1] ] )

2019-06-21 Thread Stephen Tucker
Markos, I can explain the difference from a non-numpy point of view - I hope you will be able to see how this difference affects what you are trying to do in numpy. vector_1 is an np.array consisting of a three-element list, with the three elements being 1, 0 and 1. vector_2 is an np.array consi

Re: Difference between array( [1,0,1] ) and array( [ [1,0,1] ] )

2019-06-21 Thread edmondo . giovannozzi
Every array in numpy has a number of dimensions, "np.array" is a function that can create an array numpy given a list. when you write vector_1 = np.array([1,2,1]) you are passing a list of number to thet function array that will create a 1D array. As you are showing: vector_1.shape will retur

Re: Difference between array( [1,0,1] ) and array( [ [1,0,1] ] )

2019-06-21 Thread edmondo . giovannozzi
Keep also in mind that numpy is quite different from Matlab. In Matlab every vaiable is a matrix of at least 2 dimensions. This is not the case of numpy (and is not the case in Fortran too). every array can have a different number of dimensions. The transposition of an array with just 1 dimension

pip vs python -m pip?

2019-06-21 Thread Malcolm Greene
64-bit Python 3.6.8 running on Windows with a virtual environment activated. "pip -v" reports 19.0.3 "python -m pip" reports 19.1.1 Is this behavior by design or a bug? My takeaway is that its better to run "python -m pip ..." vs "pip ..." when running pip related tasks. Thoughts? Malcolm --

Re: pip vs python -m pip?

2019-06-21 Thread Bill Deegan
you must be picking up pip from a different python installl (or virtualenv) than you are picking up python. Check your %PATH% On Fri, Jun 21, 2019 at 6:29 AM Malcolm Greene wrote: > 64-bit Python 3.6.8 running on Windows with a virtual environment > activated. > > "pip -v" reports 19.0.3 > "pyth

How to force "python -m site" ENABLE_USER_SITE to false?

2019-06-21 Thread Malcolm Greene
Any suggestions on how one can force the "python -m site" ENABLE_USER_SITE value to false? Is it possible to globally force this setting - across all users - when installing a system wide version of Python ... or via a command line option when starting a Python session? Motivation: When ENABLE

Re: pip vs python -m pip?

2019-06-21 Thread Malcolm Greene
> you must be picking up pip from a different python install (or virtualenv) > than you are picking up python. > Check your %PATH% That was our first guess. Only one version of Python installed on the system (we install on an empty, freshly serviced pack Windows VM). Only one version of python*

Re: pip vs python -m pip?

2019-06-21 Thread Thomas Jollans
On 21/06/2019 15.27, Malcolm Greene wrote: > 64-bit Python 3.6.8 running on Windows with a virtual environment activated. > > "pip -v" reports 19.0.3 > "python -m pip" reports 19.1.1 > > Is this behavior by design or a bug? If the pip and python executables you're calling both live in the virtual

Re: pip vs python -m pip?

2019-06-21 Thread Chris Angelico
On Fri, Jun 21, 2019 at 11:55 PM Malcolm Greene wrote: > > > you must be picking up pip from a different python install (or virtualenv) > > than you are picking up python. > > Check your %PATH% > > That was our first guess. Only one version of Python installed on the system > (we install on an e

Re: How to force "python -m site" ENABLE_USER_SITE to false?

2019-06-21 Thread Ed Leafe
On Jun 21, 2019, at 8:49 AM, Malcolm Greene wrote: > > Any suggestions on how one can force the "python -m site" ENABLE_USER_SITE > value to false? > > Is it possible to globally force this setting - across all users - when > installing a system wide version of Python ... or via a command line

Re: How to force "python -m site" ENABLE_USER_SITE to false?

2019-06-21 Thread Malcolm Greene
> From: Ed Leafe > StackOverflow: > https://stackoverflow.com/questions/25584276/how-to-disable-site-enable-user-site-for-an-environment Thanks Ed! My takeaway from the above article and our path going forward is to explictly force ENABLE_USER_SITE to false via Python's "-s" switch. Malcolm --

Re: pip vs python -m pip?

2019-06-21 Thread Malcolm Greene
> From: Chris Angelico > Are you doing this in cmd.exe, powershell, bash, or some other shell? Same result via cmd.exe and PowerShell (ps1). > There are a LOT of ways that the Windows path can fail to pick up the correct > 'pip'. Normally activating a venv should let you use "pip" to mean the r

Re: pip vs python -m pip?

2019-06-21 Thread Skip Montanaro
Malcolm> Running pip as a package (python -m pip) will force the use of the virtual env copy of pip. Running pip as an application vs package may use the system version of pip. I believe it is for just this reason that the recommended spelling these days is "python -m pip". Skip -- https://mail.

Re: Difference between array( [1,0,1] ) and array( [ [1,0,1] ] )

2019-06-21 Thread MRAB
On 2019-06-21 02:39, Markos wrote: Hi, I'm studying Numpy and I don't understand the difference between vector_1 = np.array( [ 1,0,1 ] ) with 1 bracket and vector_2 = np.array( [ [ 1,0,1 ] ] ) with 2 brackets The shape of vector_1 is: vector_1.shape (3,) But the shape of vector_2 i