▶ Watch Entire Numpy Playlist ✅ Subscribe To My TH-cam Channel: bit.ly/3Q7frEH bit.ly/2IGzvOR ▶ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN ▶ Get The Code: bit.ly/3mp2qJ3
The view creates another reference to the array. same is achieved by the assignment array_a = array_b then any change to either array will affect the one since both refer the same data in memory
The latter means np2 and np1 are exactly the same array, if you print the memory address of np2 and np1, they'll have the same address. in the first one however, they are stored in different places in memory. If you've done pointers in C, this'd make a lot of sense.
I think it is very confusing to refer to a view as "a copy connected to the original array". It would be better to refer to it as an alias for the the original array.
▶ Watch Entire Numpy Playlist ✅ Subscribe To My TH-cam Channel:
bit.ly/3Q7frEH bit.ly/2IGzvOR
▶ See More At: ✅ Join My Facebook Group:
Codemy.com bit.ly/2GFmOBz
▶ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN
▶ Get The Code:
bit.ly/3mp2qJ3
So, the view( ) creates an array whose elements are always pointing at the elements of the original array??
The view creates another reference to the array. same is achieved by the assignment array_a = array_b
then any change to either array will affect the one since both refer the same data in memory
aka a "pointer"
This is amazing ! Thank you very much :)
Glad you enjoyed it!
Informative as usual
Thanks
Nice ❤
how do you type in the italic f inside the print(f'Original NP1 {np1}' ?
I don't, sublime does all that automatically.
View is like a Reference in CPP. You change the ref var but you also change the OG var. Copy is just copy.
What the difference between np2 = np1.view() and np2 = np1?😅
Let 's try this code to see the difference
import numpy as np
np1 = np.array([1, 2, 3, 4, 5])
# np2 = np1.view()
np2 = np1
np2.shape = (5, 1)
np1 = np1.astype(float)
print("np1:", np1)
print("np2:", np2)
The latter means np2 and np1 are exactly the same array, if you print the memory address of np2 and np1, they'll have the same address. in the first one however, they are stored in different places in memory. If you've done pointers in C, this'd make a lot of sense.
Simple,
Copy - Call by Value
View - Call by reference
sir is this playlist really enough for ML ?
Of course not, it's an introduction
@Codemycom OK can you recommend Playlist to watch after your Playlist now iam in sixth video
@@AbdallahAnalyst I have a pandas playlist and a Pytorch playlist
hi john , i want some help to build kivy app (i have the app ready)
I have a kivy playlist
Sir, make a video to upload & retrieve images in database and display images on tkinter GUI window !!!!
💪🏻💪🏻
:-)
I think it is very confusing to refer to a view as "a copy connected to the original array". It would be better to refer to it as an alias for the the original array.
yeah, because that's different in some way
@@Codemycom Yeas. A copy uses more memory, an alias does not.
@@gedtoon6451 lol
@@Codemycom what is funny about it
that means if np1 is view of np2 then np2 is also of np1 !!!!!!!