Just gotten back on the laptop after an extended break and can't seem to complete this simple task! I've got a large dataset, and just going about my preprocessing and I can't seem to mark and drop the rows with a '?'. I've tried repeatedly to replace said '?'s with NaN so I can drop them willy nilly, though nothing seems to be affecting the dataset whatsoever.
Most seem to drop the rows if a value occurs in a particular column, though I don't want to go through each column, rather just the entire dataset at once. Also because my rows have different types then that perhaps is causing some friction: all mixed between float and object.
Here's what I've tried:
![[Image: r2TD02D]](https://imgur.com/r2TD02D)
I can't seem to work out how to edit my original post, so if a mod could join these two together I would be eternally grateful!
Most seem to drop the rows if a value occurs in a particular column, though I don't want to go through each column, rather just the entire dataset at once. Also because my rows have different types then that perhaps is causing some friction: all mixed between float and object.
Here's what I've tried:
train = pre_train.replace('?', 'np.Nan') train = pre_train.replace({'?': np.nan}).dropna() train = pre_train.replace({to_replace = "?", value = "NaN"}) train = pre_train.where(pre_train != '?', other = 'NaN')And I can't seem to get any to work, so any help is appreciated. Will offer a little segment of what the dataset looks like (note there are more columns). If I do the opposite and attempt to rid my df of all rows that contain an element that is not '?', and I manage to clear the df, so really confused by this!
I can't seem to work out how to edit my original post, so if a mod could join these two together I would be eternally grateful!