i have this code:
dfx = pd.read_csv('hasil_processing_auto.csv', encoding='unicode_escape')
dy = dfx.loc[:,'polarity']
X = dy.values
print(X)
and this is the output i get:
['[0]' '[0]' '[0]' '[0]' '[0]' '[0]' '[0]' '[0]' '[0]' '[0]' '[0]' '[0]'
'[1]' '[0]' '[0]' '[0]' '[0]' '[0]' '[0]' '[1]']
i want it to be just like [0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1]
the csv is like this:
tweets label polarity
0 i love myself kuliah tugas tumpuk sapu ngepel ... Netral [0]
1 suogh online online kuliah Netral [0]
2 bisnis sekolah kuliah ngantor online shop prod... Netral [0]
3 tunggu surat putus rektor surat putus dekan la... Netral [0]
4 kuliah online bosan Netral [0]
.....
ast.literal_evalread_csvloads those[0]column values as strings. This sort of thing often occurs when you save a dataframe ascsv, and the original frame had lists (or array) elements.csvis best used when the dataframe has simple column elements - numbers and strings.