Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

loading .dat file in python

import numpy as np

data = np.genfromtxt('sample.dat',
                     skip_header=1,
                     skip_footer=1,
                     names=True,
                     dtype=None,
                     delimiter=' ')
print(data)
# Output: [(1, 4, 6, 8, 3) (4, 5, 6, 8, 9) (2, 3, 6, 8, 5)]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #loading #file #python
ADD COMMENT
Topic
Name
5+2 =