plot distribution of a single feature python code example

Example 1: distribution seaborn

x = np.random.normal(size=100)
sns.distplot(x);

Example 2: distribution analysis pandas

data.loc[(data["Gender"]=="Female") & (data["Education"]=="Not Graduate") & (data["Loan_Status"]=="Y"), ["Gender","Education","Loan_Status"]]

Example 3: mean =[0,0] covariance = [[1,0],[0,100]] ds = np.random.multivariate_normal(mean,covariance,500) dframe = pd.DataFrame(ds, columns=['col1', 'col2']) fig = sns.kdeplot(dframe).get_figure() fig.savefig('kde1.png')

mean =[0,0]
covariance = [[1,0],[0,100]]

ds = np.random.multivariate_normal(mean,covariance,500)

dframe = pd.DataFrame(ds, columns=['col1', 'col2'])

fig = sns.kdeplot(dframe).get_figure()
fig.savefig('kde1.png')

Example 4: distribution analysis pandas

#First we import scipy function to determine the mode
from scipy.stats import mode
mode(data['Gender'])