- #1
member 428835
Hi PF!
I am trying to import k.txt file into Mathematica as a list of numbers. The k.txt looks like this:
[5.315967917338153e-06, -3.204321972222162e-08, 3.6041782425371564e-09, -3.853442465663655e-08, 8.699510604529962e-07, -1.4284341965847237e-08, 2.855341882658808e-09, -1.1022087781880504e-08, 2.884254278951357e-07]
Currently I'm trying ReadList["k.txt", String] but this imports the entire list as a string (obviously) which I then don't know how to extract numbers. Any ideas? Alternatively, since k.txt is being created in Python, perhaps there's a way to export python list to mathematica list (I've googled it but can't seem to get it working).
I am trying to import k.txt file into Mathematica as a list of numbers. The k.txt looks like this:
[5.315967917338153e-06, -3.204321972222162e-08, 3.6041782425371564e-09, -3.853442465663655e-08, 8.699510604529962e-07, -1.4284341965847237e-08, 2.855341882658808e-09, -1.1022087781880504e-08, 2.884254278951357e-07]
Currently I'm trying ReadList["k.txt", String] but this imports the entire list as a string (obviously) which I then don't know how to extract numbers. Any ideas? Alternatively, since k.txt is being created in Python, perhaps there's a way to export python list to mathematica list (I've googled it but can't seem to get it working).