@warrior wrote:
When I run this code from the tutorial:
#Import mode function: from scipy.stats import mode #Determing the mode for each outlet_size_mode = data.pivot_table(values='Outlet_Size', columns='Outlet_Type',aggfunc=(lambda x:mode(x).mode[0])) print ('Mode for each Outlet_Type:') print (outlet_size_mode)
I get
TypeError: '<' not supported between instances of 'str' and 'float'
I know the error occurs because Outlet_Size has missing values but I’m not sure how to correct it.
Posts: 1
Participants: 1