I want to include DBSCAN labels as new column in previous Data that I generated using pd.read_csv command. I am running below line.
bit_data['DBSCAN']=dbscan.labels_.astype(int)
but I am getting this error.
IndexError Traceback (most recent call last) in () ----> 1 bit_data['DBSCAN']=dbscan.labels_.astype(int)
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices
The error is on the left side.
That variable
bit_dataprobably is an array, and does not allow a string index:bit_data['DBSCAN']You probably meant to use a data frame