I have a column in my DataFrame which contains values 1, 0, and backorder. I used the strip() method to remove the backorder values in order to get this code to work, but now it won't run with empty cells. Is there a way to just skip over these empty boxes since i don't want them or their surrounding columns to be affected.
My code is attempting to make a new column using the 1s and 0s.
final_dataframe = final_dataframe.applymap(lambda df_value: str(df_value).rstrip('backorder'))
#Removes "backorder" from In stock? column (temporarily)
final_dataframe['In stock?'] = final_dataframe['In stock?'].astype(int)
conditions = [
(final_dataframe['In stock?'] == 1 & [final_dataframe['qty_total'] < 1]),
(final_dataframe['In stock?'] == 0 & [final_dataframe['qty_total'] >= 1])
]
t_or_f = ['True', 'False']
final_dataframe['Unlist This']
print(final_dataframe)