There is a string use[1] = "строка \n string".encode('utf-8') translate the code into bytes and put it in the Pandas table and save the table in csv. In the byte code in order to be able to extract the string in the future as it contains the \ n character of the carry to a new line. If you leave with this sign, the table is not readable in the future. then I read the table train_dataset = np.genfromtxt('data', usecols=use[1:4], delimiter=';',dtype=object,skip_header=1) . I transfer the data from the code bytes to utf-8 and I got a string of bytes of type String but the bytes are listed there.
for x in range(train_dataset.shape[0]): train_dataset[x][0]=train_dataset[x][0].decode('utf-8') train_dataset[x][1] = train_dataset[x][1].decode('utf-8') train_dataset[x][2] = train_dataset[x][2].decode('utf-8') print(train_dataset) "b'\\xd1\\x81\\xd1\\x82\\xd1\\x80\\xd0\\xbe\\xd0\\xba\\xd0\\xb0 \\n \\xd1\\x81\\xd1\\x82\\xd1\\x80\\xd0\\xb8\\xd0\\xbd\\xd0\\xb3'" result is a string type, how to convert to a type byte