Slice:
Loc
Df.loc[num]: Select a line of DF series
DF.LOC[[NUM1,NUM2]]: Select a few lines of DF
Df.loc[[true,false,true, True]]: Select a few lines of DF
Df.loc[num,[' A ', ' C ']: Select a row of DF N column
Df.loc[[num1,num2],[' A ', ' C ']: Select a few rows of df N columns
Df.loc[[true,false,true, true],[' A ', ' C ']: Select a few rows of DF N column
#loc to mark rows with numbers, Booleans, and their lists, column names, and their list tag columns.
Df.iloc[num]: Select a line of DF series
DF.ILOC[[NUM1,NUM2]]: Select a few lines of DF
Df.iloc[[true,false,true, True]]: Select a few lines of DF
Df.iloc[num,num]: Select DF a line num column
df.iloc[[num1,num2],[2,4,5]]: Select a few rows of DF
Df.iloc[[true,false,true, True],3:5]: Select a few rows of df N columns (left closed right)
#iloc to mark rows with numbers, Booleans, and their lists, and tag columns with numbers and their lists
# #loc, Iloc The main difference is that Loc chooses certain columns to be selected only with column names, Iloc can only be selected with numbers,
Even if the column name is a number, it is no exception. Slice selection column, starting from 0, left closed right open is not included on the right.
Index rows by criteria: df[df[' a ']==0]
Vertical merge: Append need to re-assign the value to the variable, not directly change the variable like list.append ()
Df=df.append (DF2)
Summary of common skills of pandas