import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randint(0,100,size=(100, 4)), columns=list('ABCD'))
#%%
"""
iterrows()
"""
for index, row in df.iterrows():
print(row['A'], row['B'])
#%%
"""
itertuples()
"""
for row in df.itertuples():
print(row.A, row.B)
#%%
"""
iteritems()
"""
for col, value in df.iteritems():
print(col, value)
#%%
"""
iterrows()
"""
for index, row in df.iterrows():
print(row['A'], row['B'])
#%%
"""
apply()
"""
df.apply(np.sum)
#%%
"""
applymap()
"""
df.applymap(lambda x: x*100)
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)