text_plain_output_1.png
from scipy.stats import chi2

from scipy.stats import chi2_contingency

from scipy.stats import mannwhitneyu

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

df = pd.read_csv('../input/women-entrepreneurship-and-labor-force/Dataset3.csv', header=0, sep=';', names=['No', 'Country', 'Level of development', 'European Union Membership', 'Currency', 'Women Entrepreneurship Index', 'Entrepreneurship Index', 'Inflation rate', 'Female Labor Force Participation Rate'])

df['Level of development'] = pd.get_dummies(df['Level of development'], drop_first=True)
df['European Union Membership'] = pd.get_dummies(df['European Union Membership'], drop_first=True)
df['Currency'] = pd.get_dummies(df['Currency'], drop_first=True)

for i in range(len(df)):
    if df.iloc[i, 2] == 0:
        df.iloc[i, 2] = 1
    elif df.iloc[i, 2] == 1:
        df.iloc[i, 2] = 0
    if df.iloc[i, 3] == 0:
        df.iloc[i, 3] = 1
    elif df.iloc[i, 3] == 1:
        df.iloc[i, 3] = 0
    if df.iloc[i, 4] == 0:
        df.iloc[i, 4] = 1
    elif df.iloc[i, 4] == 1:
        df.iloc[i, 4] = 0

from scipy.stats import chi2_contingency
from scipy.stats import chi2
chi, pval, dof, exp = chi2_contingency(pd.crosstab(df['Level of development'], df['European Union Membership']))
significance = 0.05
p = 1 - significance
critical_value = chi2.ppf(p, dof)

from scipy.stats import mannwhitneyu
p = mannwhitneyu(df['Women Entrepreneurship Index'], df['Entrepreneurship Index'])
alpha = 0.05
if p[1] > 1.96 or p[1] < -1.96:
    print('There is no diffrenece between the ranks of the two columns p =', p[1])
else:
    print('There is diffrenece between the ranks of the two columns p =', p[1])