Need help getting this to work: import sys sys.path.append('/Users/...') import warnings warnings.simplefilter(ignore) import pandas as pd
Question:
Need help getting this to work:
import sys
sys.path.append('/Users/...')
import warnings
warnings.simplefilter("ignore")
import pandas as pd
data0=pd.read_excel('ks-projects-cleaned1.xlsx')
data_rule=data0 # We keep a copy of the original data for association rule analysis, because we don't need to fill missing values.
data0=data0.fillna(data0.mean()) #Replace missing values of numeric attributes with the mean of the attribute
data0=data0.fillna('Missing') #Replace missing values of categorical attributes with string 'Missing'
data_clu=data0 #keep a copy of the data for clustering because it will be further processed for clustering.
data0.head(9).transpose()
from cat_to_dummy_Functions1 import cat_to_dummy data0=cat_to_dummy(data0,['state','country']) #Convert categorical values to 0/1. Used for classification & numeric prediction data0.head().transpose()
Here is the function:
def cat_to_dummy(data,list): import pandas as pd for i in list: data=pd.concat([data, pd.get_dummies(data[i], prefix = i)], axis = 1) data=data.drop(list, axis = 1) return data
Here is what I am currently getting:
Here is the data:
Project Management The Managerial Process
ISBN: 9781260570434
8th Edition
Authors: Eric W Larson, Clifford F. Gray