(Oct-01-2018, 09:58 PM)SchroedingersLion Wrote: Isn't this a bit contradictory from a programming point of view?No, it depends on the implementation for a particular type/object. i.e. the creators of numpy implemented this functionality for numpy
array
object (that is what np.linspace returns). The python core developers did not implement that functionality for the list
. You can use list comprehension instead. Or convert expectation_val_V to numpy array.Also note that when you multiply a list by int constant, the new list is not constructed by multiplying individual elements of the original list.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs