Skip to content
Advertisement

Tag: conditional-statements

How can I find the sum of a users input?

Above is a code I have so far. It prints: My goal is for the code to add up the two services and make a total price. My end goal should look like this: Notice how the code added both prices and made a “Total.” Is there any way I can do this? I’m a beginner computer science major, so

Pandas fillna based on a condition

I’m still new to pandas, but I have a dataframe in the following format: and I’m trying to fill all NaN fields in the ‘d_header’ column using the following conditions: ‘d_header’ column should be set only for rows belonging to the same group the group should be determined by the ‘d_prefix’ column value of a row immediately after non-Nan ‘d_header’

Advertisement