What is the technical difference between selecting columns in Pandas DataFrame by providing column as atribute or as a string in the brackets (sorry, don't know exact expresion of what it is called)?
Example:
df = pd.read_csv("file.csv", index_col=0)
df1 = df[df.village == 1]
df2 = df[df['village'] == 1]
df1 is df2
returns False
.
Also, would appreciate if someone could explain any further possible manipulation differences between newly created df1 and df1. I mean can I return different results compared to each method?
I also wasn't able to compare their ==
value. Don't know how.