+ 1
arr(arr(arr
The number of arr needed in front of the code and when is a bit confusing. I'm assuming that it's used twice when creating a new array by once when using the sum function but I'm not sure as to why.... Any answers???
7 Antworten
+ 1
It's from the machine learning in the basic module on applying a mask to the array.... I searched for it just now but it's changed and has less arrr and is way less confusing.... I sorta get it now but I'm still wondering about how we're creating a new dataframe but not having to save it to a variable
+ 1
I could have sworn that there were 3 arr( before the update... Anyway...here's the new code.... I'm still question the variable part
https://code.sololearn.com/c3oysy6yRagQ/?ref=app
+ 1
You did save the new dataframe in the df variable
Then, you limit the number of data/row to 10 in arr
After that, you created a mask which are used to filter away data in arr with age < 18 ( you can try print(mask), turns out it's an array of boolean)
Finally, you applied the mask on arr with arr[mask]
0
Can you refer us to the code? Or at least mention which language we are discussing?
0
So am I modifying the df variable or is the mask just like an instance?
0
Nope, you are not modifying the df or even the arr, the code is only storing the last 10 data from df into arr & filtering the arr the with the mask
From what I observe from print(mask), mask is an array of boolean
0
Hmmm.... Thanks friend