A/B Testing for ShoeFly.com

I was struggling on this one to come up with how to add a percentage column in this example.

I have a data frame with three columns: day, False, True
day has days of the week
False has a number value (the number of times False was counted)
True has a number value (the number of times True was counted)

if I write:

print(df['day'])

I get all the values in that column as expected. However when I type:

print(df['True'])

I get an error.

And when I type:

print(df[True])

I get the values in the True column. Why does df[‘True’] not work in this case?

I just figured the answer out. So I’m going to answer it in case anyone else has this question.

If you print the names of the columns using:

print(df.columns)

you get the columns which are, in this case:
‘day’, False, True

that’s is why [‘False’] doesn’t work. Because it’s not a string. I didn’t realize you could have a column that wasn’t a string.