load_file_in_context('script.py') try: shoe_counts_pivot except NameError: fail_tests('Did you remember to define `shoe_counts_pivot`?') ans = orders.groupby(['shoe_type', 'shoe_color']).id.count().reset_index()\ .pivot(columns='shoe_color', index='shoe_type', values='id')\ .reset_index() if (set(ans.columns) - set(shoe_counts_pivot.columns)) == set(['shoe_type']): fail_tests('Did you remember to use `reset_index()` after `pivot`?') elif set(shoe_counts_pivot.columns) != set(ans.columns): fail_tests('It looks like you have the wrong columns. You should have {}, but you have {}.'.format( ', '.join(ans.columns), ', '.join(shoe_counts_pivot.columns))) pass_tests()