Scipy stats.mode does not return maximum value
I am new to scipy. I am trying to get the maximum value of a row column.
Here is my code:
import pandas as pd
import numpy as np
from scipy.stats import mode
print ("Maximum Occurence of Store Owner " + str(mode(df_units["StoreOwner"], nan_policy='omit').mode[0]))
Here are the first few lines of store owner data:
0 Muhammed MacIntyre
1 Barry French
2 Barry French
3 Clay Rozendal
4 Carlos Soltero
In the above code, I am trying to get the maximum value of the owner of the owner in datframe format. But it returns all values as they are.
+3
source to share
2 answers