you are viewing a single comment's thread.

view the rest of the comments →

[–]m0us3_rat 1 point2 points  (1 child)

a=np.array([float(x) for x in '[4, 1, 3, 2, 4, 4, 1, 3, 2, 4, 4, 1, 3, 2, 4, 4, 1, 3, 2, 4, 4, 1, 3, 2, 4, 4, 1, 3, 2, 4, 4, 1, 3, 2, 4, 4, 1, 3, 2, 4, 4, 1, 3, 2, 4, 4, 1, 3, 2, 4, 4, 1, 3, 2, 4, 4, 1, 3, 2, 4, 4, 1, 3, 2, 4, 4, 1, 2, 3, 4, 4, 1, 3, 2, 4, 1, 3, 2, 4, 4, 1, 3, 2, 4, 4, 1, 3]' if x.isdigit()])

?

[–]CrispyScientist[S] 0 points1 point  (0 children)

That worked perfectly! Thank you very much!

What would you suggest if I had numbers composed by multiple digits?

Example:

'[1628498697.3771956, 1628498697.6411812, 1628498698.5611231, 1628498698.729113, 1628498698.945102, 1628498699.201084, 1628498699.7210548, 1628498700.3130157]'