Reputation: 2269
Referring to Set value for particular cell in pandas DataFrame I see
df.set_value( rownum, colnum, 'Someval')
to set a given cell. Assume in my dataframe all the columns are integers.
Is there a way to use
set_value
to set a range of columns in a given row, or do I need a different function?
df.set_value ( rownum, colstart:colend, 'someval')
gave a syntax error.
After some contortion I found this:
df.ix[ rownum , colstart:colend] = 'Someval'
This one works but I was wondering about set_value or perhaps some other short way.
Upvotes: 0
Views: 2852