在数据库中插入保存\ n

时间:2019-08-02 13:07:22

标签: csv insert mariadb

我在mariaDB中插入了.csv。每行以\ n结尾。看起来像这样:

import numpy as np
from matplotlib import pyplot as plt

# input data
a = np.array([[0,0,0],[0,0,0],[1,0,0]])
b = np.array([[0,0,0],[2,2,0],[0,0,0]])
c = np.array([[3,0,0],[0,3,0],[0,0,3]])

# transform the data so that all values are either 0 or one
a = a.astype(bool)
b = b.astype(bool)
c = c.astype(bool)

# create the empty output image (heatmap)
width, height = a.shape
img = np.zeros((width, height, 3))
# put the data into the image
img[:,:,0] = a
img[:,:,1] = b
img[:,:,2] = c

plt.imshow(img)
plt.show()

插入代码:

AA;555

BB;666

问题: MariaDB将\ n标记保存到每个varchar,所以我有555 \ n等。 怎么办?

0 个答案:

没有答案