distribution analysis pandas code example
Example 1: distribution analysis pandas
data.loc[(data["Gender"]=="Female") & (data["Education"]=="Not Graduate") & (data["Loan_Status"]=="Y"), ["Gender","Education","Loan_Status"]]
Example 2: distribution analysis pandas
def num_missing(x):
return sum(x.isnull())
print "Missing values per column:"
print data.apply(num_missing, axis=0)
print "\nMissing values per row:"
print data.apply(num_missing, axis=1).head()
Example 3: distribution analysis pandas
import pandas as pd
import numpy as np
data = pd.read_csv("train.csv", index_col="Loan_ID")
Example 4: distribution analysis pandas
from scipy.stats import mode
mode(data['Gender'])