I have created some code that reads my CSV file and converts the dataset to a grayscale image. I want to know if there is any possible way to read through each row in the dataset and save each of the images created from the rows?
So far, I have got this code that reads the CSV files and creates an image using .imshow
import pandas as pd import numpy as np from sklearn.datasets import load_digits from keras.preprocessing.image import array_to_img import matplotlib.pyplot as plt data_path = "dataset_malwares.csv" data = pd.read_csv(data_path); label = data.Malware.values data = data.drop("Malware", axis=1) data = data.drop("Name", axis=1) data = data.values data = data.reshape(data.shape[0], data.shape[1], 1) data = np.tile(data, (1, data.shape[1])) plt.imshow(data[1], cmap="gray") plt.title("label: {0:}".format(label[1])) plt.show() print(data[0].shape)
I want to go through the dataset and save each image but not too sure where to start. Any suggestions would be great. Thanks :)
Rows/format of the data - I've provided a shared version of the dataset: https://1drv.ms/x/s!AqFNg8FC48SSgtZSObDmmGHs3utWog