Search code examples
pythonmachine-learningscikit-learnspydersklearn-pandas

import the dataset in Python with sci-kit learn for machine learning problems_dataset Winscosin breast cancer


Hello I try to import a dataset to spyder

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

dataset = pd.read_csv('breast-cancer-wisconsin.data1.csv')
X = dataset.iloc[:,0:9].values
y= dataset.iloc[:,9].values

but when i display the X matrix in the variable explorer it says that object arrays are currently not supported


Solution

  • Try this:

    X = dataset.drop('column_9', 1).values
    y = dataset['column_9'].values
    

    Just replace column_9 with whatever the target column's name is.