Aug-03-2020, 04:08 PM
(This post was last modified: Aug-03-2020, 04:44 PM by JoeDainton123.)
Hello all
I have a data frame which i want to extract.
I am using the following code:-
From the selected data frame called Weekly Report.
I want all rows from the first column (which is indexed with 0) that equal 75G2G2T8
This gives me the following output:-
0 True
1 False
2 True
3 False
4 False
Where I have True then those rows equals my condition in that column.
This is where i need some help.
To get the actual rows of data that meet my condition i have been told to use the following code:-
All i am doing, from my perspective, is passing in a list of True/False values and index numbers into the command:-
Can someone explain the code?
Can anyone help?
Thank you.
I have a data frame which i want to extract.
I am using the following code:-
Weekly_Report.iloc[:,0] == 75G2G2T8I interpret this code as follows:-
From the selected data frame called Weekly Report.
I want all rows from the first column (which is indexed with 0) that equal 75G2G2T8
This gives me the following output:-
0 True
1 False
2 True
3 False
4 False
Where I have True then those rows equals my condition in that column.
This is where i need some help.
To get the actual rows of data that meet my condition i have been told to use the following code:-
Weekly_Report[Weekly_Report.iloc[:,0] == 75G2G2T8]I dont understand why i need to put:-
Weekly_Report.iloc[:,0] == 75G2G2T8inside a set of square brackets with the name of the data frame Weekly_Report before it?
All i am doing, from my perspective, is passing in a list of True/False values and index numbers into the command:-
Weekly_Report[Index Values and True/False]How does this extract the actual rows??
Can someone explain the code?
Can anyone help?
Thank you.