Replacing rows of dataframe with rows of another dataframe that have the same index
I have a dataframe that has rows with indices 0 to 128 and a smaller dataframe with indices 4, 8, 105, and 107.
I made edits to the rows in the smaller dataframe and am now trying to replace rows indexed 4, 8, 105, and 107 in the large dataframe with rows indexed 4, 8, 105, and 107 in the smaller dataframe.
Why can I not just do:
bigDF[smallDF.index] = smallDF
How would I accomplish this replacement? Thank you!
Topic dataframe pandas indexing python
Category Data Science