def test_cat_to_polor(test_data, polar_cats):
 level_0 = len(test_data.auto_data[['cyl']].drop_duplicates())
 level_1 = len(test_data.auto_data[['cyl', 'origin']].drop_duplicates())
 num_groups = (level_0 + level_1)
 assert (len(polar_cats) == num_groups)

def test_cat_to_polor ( test_data , polar_cats ) : level_0 = len ( test_data . auto_data [ [ 'cyl' ] ] . drop_duplicates ( ) ) level_1 = len ( test_data . auto_data [ [ 'cyl' , 'origin' ] ] . drop_duplicates ( ) ) num_groups = ( level_0 + level_1 ) assert ( len ( polar_cats ) == num_groups )
check known example for how many rows should exist based on columns .