Work with a row in a pandas dataframe without incurring chain indexing (not coping just indexing)
问题 My data is organized in a dataframe: import pandas as pd import numpy as np data = {'Col1' : [4,5,6,7], 'Col2' : [10,20,30,40], 'Col3' : [100,50,-30,-50], 'Col4' : ['AAA', 'BBB', 'AAA', 'CCC']} df = pd.DataFrame(data=data, index = ['R1','R2','R3','R4']) Which looks like this (only much bigger): Col1 Col2 Col3 Col4 R1 4 10 100 AAA R2 5 20 50 BBB R3 6 30 -30 AAA R4 7 40 -50 CCC My algorithm loops through this table rows and performs a set of operations. For cleaness/lazyness sake, I would like