An issue with A/B Testing for ShoeFly.com question 6

I am keep getting an error "TypeError: ‘instancemethod’ object has no attribute 'getitem
when trying to add the calculated column in question 6 in this project:
https://www.codecademy.com/paths/data-science/tracks/data-processing-pandas/modules/dspath-agg-pandas/projects/pandas-shoefly-ab-test.

this is my code

clicks_pivot['percent_clicked'] = clicks_pivot[True] / (clicks_pivot[True] + clicks_pivot[False])

I understand it related to the brackets but not sure why it is occurring, mainly when the answer is identical in the Get Hint

Hi,

Please post your full code from the exercise and we can take a look as the snippet you have shared doesn’t appear to me to be linked to the error message.

1 Like

Are you using the .get() method somewhere in your code to access a key and value in a dictionary?
b/c if you use that method it requires “( )” and not brackets.

Please post all your (formatted) code.

1 Like

Hi winningblue,

while pasting here the code i noticed that I haven’t add the parenthesis to the “reset_index” hence throwed the error.
Thanks for the prompt response and apologies for the false alarm

1 Like