Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions datasist/feature_engineering.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import seaborn as sns

from .structdata import get_cat_feats, get_num_feats, get_date_cols
from datasist.structdata import get_cat_feats, get_num_feats, get_date_cols
from dateutil.parser import parse


Expand Down Expand Up @@ -153,13 +153,13 @@ def fill_missing_num(data=None, num_features=None, method='mean', missing_col=Fa
for feat in features:
if missing_col:
df[feat + '_missing_value'] = (df[feat].isna()).astype('int64')
if method is 'mean':
if method == 'mean':
mean = df[feat].mean()
df[feat].fillna(mean, inplace=True)
elif method is 'median':
elif method == 'median':
median = df[feat].median()
df[feat].fillna(median, inplace=True)
elif method is 'mode':
elif method == 'mode':
mode = df[feat].mode()[0]
df[feat].fillna(mode, inplace=True)
else:
Expand Down
2 changes: 1 addition & 1 deletion datasist/visualizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from . import structdata
from datasist import structdata
from IPython.display import display
from sklearn.metrics import confusion_matrix
from sklearn.utils.multiclass import unique_labels
Expand Down