Home > other > Selection of dataframe locate a particular problem
Selection of dataframe locate a particular problem
Time:01-09
By understanding dateframe line selection has been the weak, feel very uncomfortable, is a practical problem, consult everybody the teacher!!!!! A column of a dateframe, to determine whether conform to the rules, does not conform to delete, what should I do? The index of df is a mess, there is no rule that For aa in df [0] : If fun (aa)=false: Delete the aa traverse to the line
"Delete the aa traverse to the line" how do you write the code?
CodePudding user response:
Conditions to choose first, reoccupy index for
Df=pd read_csv (" new CSV ") Remove_df=df [(df/" order status "==" failure ")] Df=df drop (remove_df index) Print (df)