all! I am pretty confused by this and for the life of me cannot figure out the error. I am trying to go through all the strings in a data frame and remove the ones that do n
drop
doesn't mutate your current DataFrame unless you ask it to, with inplace=True
.
With that being said, a for loop is almost certainly not the easiest approach here. Why not just boolean indexing with the str
accessor on your column, i.e. with str.contains
bb_db[~bb_db.player_names.str.contains('Barry Bonds')]