A bit of pickle. I am trying to find a single row in a dataframe by searching for a specific string value, then replace the string value with zero. I am using the following code:
selectRow = df[df.iloc[:,0].str.match(ID)]
selectRow.replace(ID, 0)
where ID is some string. This returns one row within the dataframe as expected. However, I can't seem to modify the values of the selectRow in dataframe, as the selectRow is a separate dataframe at this point.
I know I am missing something incredibly basic. Any help would be much appreciated!
CN
replace, try updateselectRowback todfas:df.update(selectRow)