I have a df in which is indexed by date and has many columns. I am working with one row at a specific date inside a function, and then I will iterate over various dates selecting one row to modify at a time.
There are many calculations for the row and I'm finding using
df.loc[current_date, 'select_columns']` #messy.
I changed the entire row to:
r = pd.Series (df.loc[current_date, :])
And that way could just work with say:
r[field_name]
I am able to view and update data doing this method and then reassign the series to the df row when the calculations are done.
While this does work, my question is ... is there a better more pythonic way to access one row in a dataframe for many calculations?