+ 1
When a python list is multiplied by an integer, the elements inside the list will just repeat itself depending on the multiplier. Example: • [2] * 10 • [2, 2, 2, 2, 2, 2, 2, 2, 2, 2] • [21, 65, 32] * 3 • [21, 65, 32, 21, 65, 32, 21, 65, 32] But in numpy, when an array is multiplied by an integer (or float, numbers in general), each elements inside the array are multiplied by that number. Example • [2] * 10 • [20] • [2, 4, 6] * 10 • [20, 40, 60]
15th Feb 2022, 2:16 AM
noteve
noteve - avatar