I am trying to import a text file (.xyz), this file looks something like this:
1 9 1 6 "Thu Feb 13 13:12:30 2014 "
0 0 0 0 0 0
38 38 915 915
"CJE "
"2 "
"110321-025-01D-1ST
0 0 1 .1 73.7972 17 50
1 0 7 1 60 0 0 0 0
0 " "
1 0
#
38 38 No Data
39 38 No Data
40 38 No Data
41 38 3
42 38 No Data
43 38 4
44 38 4
45 38 5
#
the text file has a header (the first 11 lines) which contains some numerical values as shown below, also the data is separated in three columns, one of these columns, has numerical values, but also the written characters: "No Data". I also would like to change that "No Data" for the numerical value 0.
I can skip the Header, but the main Problem that I have it to tell the Code that there are three columns and that where there is "no data" that means 0. this is what I used up to now,
import numpy as np
data = np.genfromtxt('180228_Test V2-4_0grad.xyz',
skip_header=11,
skip_footer=1,
names=True,
dtype=None,
delimiter=' ')
print(data)