0

I am using

genfromtxt('84MHZN01.TBL',delimiter='\t',dtype=None,skip_header=41,skip_footer=2)

to import the data like

[ b'-0.300000       0.00000      9.052297E+00  0.000000E+00  9.052297E+00  0.000000E+00'
 b'-7.700000E-02   0.00000      9.066407E+00  0.000000E+00  9.066407E+00  0.000000E+00'
 b'0.146000       0.00000      9.107430E+00  0.000000E+00  9.107430E+00  0.000000E+00'
 b'0.369000       0.00000      9.168216E+00  0.000000E+00  9.168216E+00  0.000000E+00'
 b'0.592000       0.00000      9.241816E+00  0.000000E+00  9.241816E+00  0.000000E+00'
 b'0.815000       0.00000      9.319924E+00  0.000000E+00  9.319924E+00  0.000000E+00'
 b'1.03800       0.00000      9.395081E+00  0.000000E+00  9.395081E+00  0.000000E+00']

I am try to use delimiter=' ', but not work. Shows error. How could I import the data with separate Tab or space? Also how to remove the b'? Thanks,

rfeynman
  • 97
  • 1
  • 9

1 Answers1

0

In order to take the answer given by hpaulj and write there a correct answer, you need to delimit your data by whitespace.

But, if you read the doc to better understand how you can use genfromtxt, the withespace is the default parameter of delimiter setting.

So, you just have to write :

data = np.genfromtxt('84MHZN01.TBL',dtype=None,skip_header=41,skip_footer=2)

And you will obtain what you want ;)

Essex
  • 6,042
  • 11
  • 67
  • 139