I have the next txt with data:
FI R 83.0000m 34.960 1.1262 Fe 2 1.32055m 33.626 0.0522 N
2 5754.61A 33.290 0.0241
TI R 1800.00m 33.092 0.0153 Fe 2 1.24854m 32.645 0.0054 N
2 915.612A 31.997 0.0012
NI Ra 2.85000m 36.291 24.1132 Fe 2 7637.54A 33.077 0.0147
what I want is to obtain the third column, is the wavelength of the emergent line, but my problem is when I put the condition in the if.
Name1,ion1,wavelength1,da1,de1,name2,ion2,
wavelength2,da2,de2,name3,ion3,wavelength3,da3,de3=np.genfromtxt('Emergent_line.txt',
skip_header=3, delimiter="", unpack=True)
if(Name1=="Fe" and ion1==2):
print(wavelength1)
elif(name2=="Fe" and ion2==2):
print(wavelength2)
elif(name3=="Fe" and ion3==2):
print(wavelength3)
In the txt I want to find the wavelength for Fe 2, but I think the problem is that the wavelength have a letter in the end, I don't want to delete, because I have a large list like that. I tried another froms, but I haven't solved it.