I have a csv file ready to load into my python code, however, I want to load it into the following format:
data = [[A,B,C,D],
data = np.array(data)
The simplest solution is just:
import numpy as np data = np.loadtxt("myfile.csv")
As long as the data is convertible into
float and has an equal number of columns on each row, this works.
If the data is not convertible into
float in some column, you may write your own converters for it. Please see the
numpy.loadtxt documentation. It is really very flexible.