# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

import numpy as np
import pandas as pd

df=pd.read_csv('Data.csv')
print("\n")

print(df.columns)

print("\n")

print(df.shape)

print("\n")

print(df.corr())
print("\n")

print("Max Salary value is in row number: ",df['Salary'].idxmax()) #it will print the  row number of maximum value in that column

print("Salary to age ratio is",df['Salary']/df['Age'])

print("\n")
print(df.isnull().sum())

print("\n")
print(df['Salary'].isnull())


#method 1

df.loc[4,'Salary']=40000

print(df)

#method 2

df['Age'].fillna(45,inplace=True)

print(df)

#method 3

df.dropna(thresh=3)


#Segregation of input and output variables

X=df.iloc[:,0:3].values
y=df.iloc[:,3].values


#method 4

from sklearn.impute import SimpleImputer
imputer=SimpleImputer(missing_values=np.nan,strategy='mean')
imputer.fit(X[:,1:3])
X[:,1:3]=imputer.transform(X[:,1:3])




















cc2e4bca9ed30ccde73df340009227c256ebbf2a
<mask token>

<mask token>
print('\n')
print(df.columns)
print('\n')
print(df.shape)
print('\n')
print(df.corr())
print('\n')
print('Max Salary value is in row number: ', df['Salary'].idxmax())
print('Salary to age ratio is', df['Salary'] / df['Age'])
print('\n')
print(df.isnull().sum())
print('\n')
print(df['Salary'].isnull())
<mask token>
print(df)
df['Age'].fillna(45, inplace=True)
print(df)
df.dropna(thresh=3)
<mask token>
imputer.fit(X[:, 1:3])
<mask token>

<mask token>
df = pd.read_csv('Data.csv')
print('\n')
print(df.columns)
print('\n')
print(df.shape)
print('\n')
print(df.corr())
print('\n')
print('Max Salary value is in row number: ', df['Salary'].idxmax())
print('Salary to age ratio is', df['Salary'] / df['Age'])
print('\n')
print(df.isnull().sum())
print('\n')
print(df['Salary'].isnull())
df.loc[4, 'Salary'] = 40000
print(df)
df['Age'].fillna(45, inplace=True)
print(df)
df.dropna(thresh=3)
X = df.iloc[:, 0:3].values
y = df.iloc[:, 3].values
<mask token>
imputer = SimpleImputer(missing_values=np.nan, strategy='mean')
imputer.fit(X[:, 1:3])
X[:, 1:3] = imputer.transform(X[:, 1:3])

<mask token>
import numpy as np
import pandas as pd
df = pd.read_csv('Data.csv')
print('\n')
print(df.columns)
print('\n')
print(df.shape)
print('\n')
print(df.corr())
print('\n')
print('Max Salary value is in row number: ', df['Salary'].idxmax())
print('Salary to age ratio is', df['Salary'] / df['Age'])
print('\n')
print(df.isnull().sum())
print('\n')
print(df['Salary'].isnull())
df.loc[4, 'Salary'] = 40000
print(df)
df['Age'].fillna(45, inplace=True)
print(df)
df.dropna(thresh=3)
X = df.iloc[:, 0:3].values
y = df.iloc[:, 3].values
from sklearn.impute import SimpleImputer
imputer = SimpleImputer(missing_values=np.nan, strategy='mean')
imputer.fit(X[:, 1:3])
X[:, 1:3] = imputer.transform(X[:, 1:3])

# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

import numpy as np
import pandas as pd

df=pd.read_csv('Data.csv')
print("\n")

print(df.columns)

print("\n")

print(df.shape)

print("\n")

print(df.corr())
print("\n")

print("Max Salary value is in row number: ",df['Salary'].idxmax()) #it will print the  row number of maximum value in that column

print("Salary to age ratio is",df['Salary']/df['Age'])

print("\n")
print(df.isnull().sum())

print("\n")
print(df['Salary'].isnull())


#method 1

df.loc[4,'Salary']=40000

print(df)

#method 2

df['Age'].fillna(45,inplace=True)

print(df)

#method 3

df.dropna(thresh=3)


#Segregation of input and output variables

X=df.iloc[:,0:3].values
y=df.iloc[:,3].values


#method 4

from sklearn.impute import SimpleImputer
imputer=SimpleImputer(missing_values=np.nan,strategy='mean')
imputer.fit(X[:,1:3])
X[:,1:3]=imputer.transform(X[:,1:3])



















