-
Notifications
You must be signed in to change notification settings - Fork 29
/
eksikveriler.py
65 lines (37 loc) · 890 Bytes
/
eksikveriler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 15 04:18:20 2018
@author: sadievrenseker
"""
#kutuphaneler
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
#kodlar
#veri yukleme
veriler = pd.read_csv('eksikveriler.csv')
#pd.read_csv("veriler.csv")
print(veriler)
#veri on isleme
boy = veriler[['boy']]
print(boy)
boykilo = veriler[['boy','kilo']]
print(boykilo)
x = 10
class insan:
boy = 180
def kosmak(self,b):
return b + 10
ali = insan()
print(ali.boy)
print(ali.kosmak(90))
#eksik veriler
#sci - kit learn
from sklearn.preprocessing import Imputer
imputer= Imputer(missing_values='NaN', strategy = 'mean', axis=0 )
Yas = veriler.iloc[:,1:4].values
print(Yas)
imputer = imputer.fit(Yas[:,1:4])
Yas[:,1:4] = imputer.transform(Yas[:,1:4])
print(Yas)