loadtxt command not working
Title
Question
loadtxt command not working
showing error
%pycat is successful.
In [30]: %pycat C:\Users\Pavilion15\Downloads\primes.txt
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
73
79
83
89
97
In [31]: primes=loadtxt("C:\Users\Pavilion15\Downloads\primes.txt")
File "<ipython-input-31-e07a60e37db7>", line 1
primes=loadtxt("C:\Users\Pavilion15\Downloads\primes.txt")
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
Python-3.4.3 Loading-Data-From-Files 02-03 min 0-10 sec
Answers:
got answer
file path was too long
i have reduced it
and got command executed
In [47]: %pycat E:\primes.txt
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
73
79
83
89
97
In [48]: primes = loadtxt("E:\primes.txt")
In [49]: print(primes)
[ 2. 3. 5. 7. 11. 13. 17. 19. 23. 29. 31. 37. 41. 43. 47. 53. 59. 61.
67. 71. 73. 79. 83. 89. 97.]
Login to add comment