So I am trying to conditional selection by storing a string for A,(eg. A = 'foo') so that I can see the data for only "foo" or "bar." However, if I want to actually see everything, is there a string I can use to select everything? I'm sorry that this sound very confusing, let me demonstrate what I mean.
this is my data frame:
# A B C D
# 0 foo one 0 0
# 1 bar one 1 2
# 2 foo two 2 4
# 3 bar three 3 6
# 4 foo two 4 8
# 5 bar two 5 10
# 6 foo one 6 12
# 7 foo three 7 14
I can do the following to select only 'foo' in A.
selection = 'foo'
print(df.loc[df['A'] == selection])
# A B C D
# 0 foo one 0 0
# 2 foo two 2 4
# 4 foo two 4 8
# 6 foo one 6 12
# 7 foo three 7 14
Or I can easily change what is stored in "selection" to get "bar" as well. Now, what if I want to select everything in column A, but I do not want to change anything else other than what is stored in "selection"?