I have a data-frame of size (140000,22) dimensions.
i have to create 2d array of equal dimensions to pass it into convolution neural network .
Can you please guide how to transform on this dataframe
I have a data-frame of size (140000,22) dimensions.
i have to create 2d array of equal dimensions to pass it into convolution neural network .
Can you please guide how to transform on this dataframe
You just need to call .values on the DataFrame.
If for example your dataframe is called df, then you can pass df.values to your convolutional neural network.
Use arr = df.to_numpy()
See: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_numpy.html
It will create a 2d array where each row is the inner array.
[[row1],
[row2],
[row3]...
[row n]]
To turn it into a 2d array where each column is the inner array, use transpose:
arr = np.transpose(arr)
[[all_data_in_col_1],
[all_data_in_col_2],...
[all_data_in_col_n]]