如何修复从 Python 中的 x_train 派生的图像中重塑过程的问题?

How can I fix the issue to reshape process in image derived from x_train in Python?

我从 Kaggle 找到了一个数据集这是 link : https://www.kaggle.com/quangqiyana/human-gender-identity

我想将 CNN 算法实现到数据集中。

我写了一些代码来获得 X_train 和 Y_train

train = pd.read_csv("files/gender.csv")
train.shape -> (230, 67502)
train.drop('Unnamed: 0', axis=1, inplace=True)
Y_train = train["Label"]
X_train = train.drop(labels = ["Label"],axis = 1) 

然后我想通过iloc进程显示一些图像

img = X_train.iloc[0].to_numpy()
img = np.pad(img, (0, (67600-img.shape[0])), 'constant').reshape((260, 260))
plt.imshow(img)
plt.title(train.iloc[0,0])
plt.axis("off")
plt.show()

因为任何数都不是67502的平方,所以我可以用pad。但是图像无法以分辨率显示。

这是屏幕截图。

如何解决整形问题?

此数据集可能不适用于 CNN,因为编码到列中的数据彼此之间没有空间关系,就像在图像中一样。考虑到此数据集已下载 1(一次)次,可能是由您下载的,并且没有人创建任何笔记本或认为它值得讨论,我建议转移到另一个有其他人在处理它的数据集,这样您就可以在那里(在 Kaggle 上)提问并获得帮助。