Access content in dataframe by loc/iloc or by [ ] [ ]?

AleksandraFrolo
New Contributor III

Hello,

Task: I am trying to understand, what approach is better to access the content in DataFrame.

My piece of code:

print("First approach: ", df["Purchase Address"][0])
 
print("Second approach: ", df.loc[0,"Purchase Address"])

These lines are equal to each other. For me more comfortable to use first version. Is there any recommends in pandas how to access the content?