I have a Data frame like this,
a b c d e
1 0 0 4 5
0 23 5 0 0
0 5 8 6 0
Now, i am using a np.log on the entire data frame like this.
df = (np.log(weights_df))
Its all fine and working out. But wherever there is 0, its giving "-inf" as it is supposed to. I want to convert all of these to something else, maybe "0" in place of "-inf". I tried fillna but i do not think its going to work here.
How do i do it?

pd.set_option('use_inf_as_null', True)for inf to be regarded as NaN. Then you can usefillnaordropnafor inf values as well.