- Hands-On Python Deep Learning for the Web
- Anubhav Singh Sayak Paul
- 57字
- 2021-06-24 16:23:30
Assignment over slicing
While it is not possible to assign values to slices of Python lists, NumPy allows the assignment of values to NumPy arrays. For example, to assign 4 to the third to the fifth element of a NumPy one-dimensional array, we can use the following:
arr[2:5] = 4
Next, we will be looking at pandas.