MCPcopy Create free account
hub / github.com/Sirui-Xu/STARS / readCSVasFloat

Function readCSVasFloat

deterministic/utils/data_utils.py:197–215  ·  view source on GitHub ↗

Borrowed from SRNN code. Reads a csv and returns a float matrix. https://github.com/asheshjain399/NeuralModels/blob/master/neuralmodels/utils.py#L34 Args filename: string. Path to the csv file Returns returnArray: the read data in a float32 matrix

(filename)

Source from the content-addressed store, hash-verified

195
196
197def readCSVasFloat(filename):
198 """
199 Borrowed from SRNN code. Reads a csv and returns a float matrix.
200 https://github.com/asheshjain399/NeuralModels/blob/master/neuralmodels/utils.py#L34
201
202 Args
203 filename: string. Path to the csv file
204 Returns
205 returnArray: the read data in a float32 matrix
206 """
207 returnArray = []
208 lines = open(filename).readlines()
209 for line in lines:
210 line = line.strip().split(',')
211 if len(line) > 0:
212 returnArray.append(np.array([np.float32(x) for x in line]))
213
214 returnArray = np.array(returnArray)
215 return returnArray
216
217
218def normalize_data(data, data_mean, data_std, dim_to_use, actions, one_hot):

Callers 2

load_data_cmuFunction · 0.85
load_data_cmu_3dFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected