Quantcast
Viewing all articles
Browse latest Browse all 4448

What does mode(x).mode[0] mean?

@AnnaList wrote:

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.dropna()).mode[0]))

what does the highlighted part mean?
how does the code work?

The output is as provided.

Image may be NSFW.
Clik here to view.
image

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles