In [1]:
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from scipy.stats import norm
from sklearn.preprocessing import StandardScaler
from scipy import stats
from mpl_toolkits.mplot3d import Axes3D
from sklearn.model_selection import train_test_split
import warnings
import math
warnings.filterwarnings('ignore')
%matplotlib inline
In [2]:
def threshold(df, t, which_feature, csv_filename):
df['threshold'] = np.nan
df['threshold'] = np.where(df[which_feature] > t, 1,0)
header = ['X','Y','Z','threshold']
df.to_csv(csv_filename, columns = header, index=False)
return df
In [ ]: