I have a dataset and a column with numeric values. In order to apply a log function to the column, I need to filter negative and zero values first. How can I create a new column (or a variable) with non-Boolean values? If I apply data['new_column'] = (data['old_column'] > 0)
I can only get Boolean values which are useful for me further.
I assume my question is quite similar to the ones below, but I don't know how to transfer R syntax to Python.
How to efficiently filter a data frame? Filter values in data frame How to filter out data out of a dataset?