How to split a (569 ,31 ) dataframe into two with shapes (569 ,30) and (569, )
The dataFrame has 31 columns-
df.columns yields this -
Index([u'mean radius', u'mean texture', u'mean perimeter', u'mean area',
u'mean smoothness', u'mean compactness', u'mean concavity',
u'mean concave points', u'mean symmetry', u'mean fractal dimension',
u'radius error', u'texture error', u'perimeter error', u'area error',
u'smoothness error', u'compactness error', u'concavity error',
u'concave points error', u'symmetry error', u'fractal dimension error',
u'worst radius', u'worst texture', u'worst perimeter', u'worst area',
u'worst smoothness', u'worst compactness', u'worst concavity',
u'worst concave points', u'worst symmetry', u'worst fractal dimension',
u'target'],
dtype='object')
I need to split it into two. I did something like this -
X = df.ix[:,'mean radius': 'worst fractal dimension']
y = df.ix[:,'target': ]
X.shape
gives (569, 30) which is as expected, but y.shape gives (569,1).
I dont really understand the difference between (569,) ans (569, 1). BUt he answer required is shape of (569,)