Answers for "Convert the sklearn.dataset cancer to a DataFrame."

0

Convert the sklearn.dataset cancer to a DataFrame.

import numpy as np
import pandas as pd
from sklearn.datasets import load_breast_cancer

cancer = load_breast_cancer()
print cancer.keys()

data = pd.DataFrame(cancer.data, columns=[cancer.feature_names])
data['Target'] = pd.Series(data=cancer.target, index=data.index)

print data.keys()
print data.shape
Posted by: Guest on November-24-2020

Code answers related to "Convert the sklearn.dataset cancer to a DataFrame."

Python Answers by Framework

Browse Popular Code Answers by Language