I need to convert data from float to integer in the following code and in the "num"
command
import numpy as np
import scipy.integrate as it
from scipy import linalg
from numpy.linalg import matrix_power
##############################
# Constants
tmax = 10
t = np.arange(0.0, tmax, 0.1)
m=len(t)
print(m)
e=np.matrix([[0,1,2 ,3,4,5,6,7,8,9],
[0,1,1, 1,1,1, 1,1,1, 1]])
e1=e[0]
e2=e[1]
a=np.power(e1,2)
b=np.power(e2,2)
nrm2e=(a+b)
tnow=t
num=10*tnow
print(num)
I have tried these methods such as floor() and int() but I did not get a matrix with integer members.
here is the float matrix
[ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17.
18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35.
36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53.
54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71.
72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89.
90. 91. 92. 93. 94. 95. 96. 97. 98. 99.]
e=np.matrix
\$\endgroup\$ – Reinderien yesterday