for i, rows in df.iterrows():
x, y = df.iloc[rows].copy(), df.iloc[rows+1].copy()
df.iloc[rows], df.iloc[rows+1] = y, x
break
I get error on execution:
positional indexers are out-of-bounds`
for i, rows in df.iterrows():
x, y = df.iloc[rows].copy(), df.iloc[rows+1].copy()
df.iloc[rows], df.iloc[rows+1] = y, x
break
I get error on execution:
positional indexers are out-of-bounds`
Copyright © 2021 Jogjafile Inc.
Use
iloc
with: