Q:

single line Calculate a sum and print multiple columns pandas dataframe

I have a dataframe written like below
df = pd.read_csv(file, skiprows=1, names=['all','my','headers','named'])

from this point, how can i apply the following forumla df['my'] - df['all'] / df['headers'] and print the name from the data below, on a single line? 
example data:
all      my     headers    named
10.1     50.2   10         top
20.2     40.2   4          bottom

current attempts: 
print(df['named'] + " " + str(  (df['my'].astype(float) - df['all'].astype(float))  /  df['headers'].astype(float)  ) 

I am trying hard to do this in one single print statement with no additional variables or lines other than the single print statement provided. 
expected output:
top    1.01
bottom 5.00

A:

I believe df.apply will work here. 
df['answer'] = df.apply(lambda x: x['my'] - (x['all']/x['headers']), 1)
for index, row in df.itterrows: print(row['name'] + " - " + row['answer'])

Not a one liner, but might give you an idea of how to utilize df.apply.

