Questions tagged [.data]

2 questions
0
votes
0 answers

How do I open and parse the contents of a .data file

I have a .data file which the C++ repository I'm using generates in order to help the user with debugging. I'm not sure how to parse the file. Upon running hexdump -C filename.data to get a hexadecimal output, I get the following (this is only a…
skinnybb
  • 89
  • 2
  • 8
0
votes
1 answer

Converting .data file into numpy arrays

My file.data looks like this: "3.0,1.5,0\n 4.6,0.7,1\n 5.8,2.7,2" And I want to load this data into two numpy arrays so that it looks like this in the end: X = [ [3.0, 1.5], [4.6, 0.7], [5.8, 2.7] ] y = [0, 1, 2] If I do…
Otherness
  • 385
  • 2
  • 16