Skip to content

Commit 3c18f88

Browse files
authored
remove imports
1 parent da0fa16 commit 3c18f88

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ds11mltoolkit/data_analysis.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import pandas as pd
2+
import pickle
3+
import zipfile
4+
import scipy.stats as stats
5+
import pandas as pd
26

37
def read_url(url):
48

@@ -32,8 +36,6 @@ def read_url(url):
3236

3337
def read_csv_zip(zip_file, csv_file, sep=';'):
3438

35-
import pickle
36-
import zipfile
3739
"""
3840
Upload a CSV file from a zip file with custom separation.
3941
@@ -55,8 +57,7 @@ def read_csv_zip(zip_file, csv_file, sep=';'):
5557
return df
5658

5759
def chi_squared_test(df, feature, target):
58-
import scipy.stats as stats
59-
import pandas as pd
60+
6061
"""
6162
This function performs a chi-squared test of independence between two categorical variables.
6263
@@ -76,4 +77,4 @@ def chi_squared_test(df, feature, target):
7677
chi2, p, dof, expected = stats.chi2_contingency(contingency_table)
7778

7879
# Return the chi-squared value and p-value obtained in the test.
79-
return chi2, p
80+
return chi2, p

0 commit comments

Comments
 (0)