📜  将 sklearn.dataset 癌症转换为 DataFrame. - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:40.715000             🧑  作者: Mango

代码示例1
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