Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python - iterate with the data frame

# Option 1
for row in df.iterrows():
    print row.loc[0,'A']
    print row.A
    print row.index()

# Option 2
for i in range(len(df)) : 
  print(df.iloc[i, 0], df.iloc[i, 2]) 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #iterate #data #frame
ADD COMMENT
Topic
Name
1+3 =