import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
company= pd.read_csv("C:\\Users\\Mahesh\\Desktop\\Sravanthi\\company_Data.csv")
colnames=list(company.columns)
x=pd.get_dummies(company.iloc[:,1:11]).astype('bool')
X=pd.DataFrame(x)
y=company.iloc[:,0]
y.isnull().sum()
y=pd.get_dummies(company.iloc[:,0]).astype('bool')
Y=pd.DataFrame(y)
help(pd.DataFrame)
y = y.dropna()
y.isnull().sum()
from sklearn.model_selection import train_test_split
train,test=train_test_split(company,test_size=0.3)
x=x.drop([399],inplace=True,axis=0)
from sklearn.tree import DecisionTreeClassifier
model=DecisionTreeClassifier(criterion='entropy')
model.fit(train[X],train[Y])