pandas - reading data from csv files in python -
i trying extract data dummy csv file use inside tensorflow. dummy data has 2 columns: x (single feature column) , y (expected output).
x y 11.0 13.0 23.0 33.3 ... ... , on
right reading data so:
import pandas pd dummy_data = pd.read_csv("dummy_data.csv", sep=",") inputx = dummy_data.loc[:, 'x'].values np.reshape(inputx, [11, 1])
i reshaping numpy array because need matrix multiplication later on linear regression want ask correct way extract column csv data? there better way directly extract csv data tensor object?
there no need reshape or use .loc
or .values
:
inputx = dummy_data[['x']]
(mind list of lists [[]]
!)
Comments
Post a Comment