Updated 4 years ago
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname, _, filenames in os.walk('/kaggle/input'):
for filename in filenames:
print(os.path.join(dirname, filename))
# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using "Save & Run All"
# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session
/kaggle/input/quant-eda/__results__.html
/kaggle/input/quant-eda/__notebook__.ipynb
/kaggle/input/quant-eda/__output__.json
/kaggle/input/quant-eda/df_mi
/kaggle/input/quant-eda/df_scale_finale
/kaggle/input/quant-eda/custom.css
/kaggle/input/quant-eda/__results___files/__results___8_0.png
/kaggle/input/quant-eda/__results___files/__results___55_1.png
/kaggle/input/quant-eda/__results___files/__results___11_0.png
/kaggle/input/quant-eda/__results___files/__results___39_0.png
/kaggle/input/quant-eda/__results___files/__results___40_0.png
/kaggle/input/quant-eda/__results___files/__results___62_3.png
/kaggle/input/quant-eda/__results___files/__results___53_1.png
/kaggle/input/quant-eda/__results___files/__results___10_0.png
/kaggle/input/quant-eda/__results___files/__results___51_1.png
/kaggle/input/quant-eda/__results___files/__results___62_2.png
/kaggle/input/quant-eda/__results___files/__results___62_1.png
/kaggle/input/quant-eda/__results___files/__results___49_1.png
/kaggle/input/quant-eda/__results___files/__results___5_0.png
/kaggle/input/quant-eda/__results___files/__results___12_0.png
/kaggle/input/quant-eda/__results___files/__results___57_1.png
/kaggle/input/quant-eda/__results___files/__results___38_0.png
/kaggle/input/quant-eda/__results___files/__results___42_0.png
/kaggle/input/quant-eda/__results___files/__results___7_0.png
/kaggle/input/quant-eda/__results___files/__results___6_0.png
/kaggle/input/quant-eda/__results___files/__results___13_0.png
/kaggle/input/quant-eda/__results___files/__results___73_0.png
/kaggle/input/quant-eda/__results___files/__results___45_1.png
/kaggle/input/quant-ori/Quantmetry.csv
df = pd.read_csv('../input/quant-ori/Quantmetry.csv')
df
1. 'Specialite' (categorical) vs 'Sexe' (categorical) => Chi2
conti = pd.crosstab(df.specialite,df.sexe)
from scipy.stats import chi2_contingency
result_chi = stats.chi2_contingency(conti)
result_chi
print("statistique du test : ",result_chi[0])
print("p_value : ",result_chi[1])
print("degre de liberte : ",result_chi[2])
statistique du test : 2707.887156104577
p_value : 0.0
degre de liberte : 3