Let's say I have a Pandas Dataframe with 1000 rows and 10 columns.
There are 5 integer columns labeled i1 through i5 and 5 string columns.
How can I create a new column called DIFF which is defined as
MAX(i1,i2,i3,i4,i5) - MIN(i1,i2,i3,i4,i5)
I was having trouble using Max and Min operators because I wasn't accessing values cleanly - getting fouled up with Series. In other examples I saw online, people were doing
mydf.iloc[x]['SOME_COL']
to get a cell's value but in this example I don't want to iterate over rows, I just want to compute the new column for every row all at once.