I need your guidance on this issue i am facing, i want to some this like this:
df[x], where x is variable name that represents one of the column names. Now i want the entire column to go through this manipulation
- each value of column x should be process as below equation: ( 1 / (x * 22)) note that x here is a individual value of the column and it can be huge number since the huge number getting reciprocated (or 1 over x), it may result in exponential number (e+/-01)
- The resultant number should be replacing the original number in the dataframe
If the number is 100, the new number to be put into the dataframe is (1/((100)*22)) = 4.54e-4
Please let me know how to do it rounded to 2 decimal points.
Thanks.
df[x] = df[x].apply(lambda x: (1/((x * 22)))
This is resulting in 0 in the dataframe