Descriptive statistics - mode(), mean() and median()
C. mode() - returns the value that appears most from a set of values.
Example:-
1. import pandas as pd
import pandas as pd
df2 = pd.DataFrame({2016:{'q1':500,'q2':500,'q3':47000,'q4':49000},2017:{'q1':'A','q2':'A','q3':'A','q4':'D'},2018:{'q1':54500,'q2':51000}})
df2.mode()
Output:-
Example:-
1. import pandas as pd
import pandas as pd
df2 = pd.DataFrame({2016:{'q1':500,'q2':500,'q3':47000,'q4':49000},2017:{'q1':'A','q2':'A','q3':'A','q4':'D'},2018:{'q1':54500,'q2':51000}})
df2.mode()
Output:-
2016 | 2017 | 2018 | |
---|---|---|---|
0 | 500.0 | A | 51000.0 |
1 | NaN | NaN | 54500.0 |
Comments
Post a Comment