text_plain_output_1.png image_output_1.png
import numpy as np

import pandas as pd

import pandas as pd
data = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/breast-cancer-wisconsin.data', header=None)
data.columns = ['Sample code', 'Clump Thickness', 'Uniformity of Cell Size', 'Uniformity of Cell Shape', 'Marginal Adhesion', 'Single Epithelial Cell Size', 'Bare Nuclei', 'Bland Chromatin', 'Normal Nucleoli', 'Mitoses', 'Class']
data = data.drop(['Sample code'], axis=1)

import numpy as np
data = data.replace('?', np.NaN)

data2 = data['Bare Nuclei']
data2 = data2.fillna(data2.median())

data2 = data.dropna()

Z = (data2 - data2.mean()) / data2.std()
Z[20:25]

dups = data.duplicated()
data.loc[[11, 28]]

data2 = data.drop_duplicates()

sample = data.sample(n=3)
sample