I have some large data frames that I need to replace its values. This operation, however, is killing me and is causing my machine to run out of memory:
# replace nan with missing string
df[col].replace(np.nan, '<missing>', inplace=True)
## Unable to allocate 2.11 GiB for an array with shape (45, 6286166) and data type object
Is there another way to go about replacing values that does not involve such a high cost?