Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88054

Modify excel if function with cumulative sum into python dataframe column

$
0
0

I wan't to rewrite function from excel to column in python dataframe.

the function is

A2=IF((SUM($P$2:P2)+HelpTables!$D$2)<=500000,10,IF((SUM($P$2:P2)+HelpTables!$D$2)<=1000000,20,30))

It is second row, the third looks like

A3=IF((SUM($P$2:P3)+HelpTables!$D$2)<=500000,10,IF((SUM($P$2:P3)+HelpTables!$D$2)<=1000000,20,30))

and so on.

The HelpTables!$D$2 is only number, but I have to keep it as variables.

I want to apply this function into dataframe in python script, but I don't know how do it. Let's say Column P is names as 'Price' in dataframe, Column A as 'Line' and the variable is as float64 variable named as 'SUM'

Can you please help me how o do it? Thank you.


Viewing all articles
Browse latest Browse all 88054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>