利用dataset.columns为表格加表头
程序员文章站
2024-02-04 21:19:34
...
import pandas as pd
import numpy as np
dataset = pd.read_csv('wdbc.csv', header =None)
columns = ['mean radius', 'mean texture','mean perimeter', 'mean area','mean smoothness',
'mean compactness','mean concavity','mean concave points','mean symmetry', 'mean fractal dimension',
'radius error', 'texture error','perimeter error','area error','smoothness error',
'compactness error','concavity error', 'concave points error','symmetry error', 'fractal dimension error',
'worst radius', 'worst texture','worst perimeter', 'worst area','worst smoothness',
'worst compactness','worst concavity', 'worst concave points','worst symmetry', 'worst fractal dimension','ill']
dataset.columns = columns
dataset