0

Daer Folks,

I like to create a 2D Array, one colum with datetime values. So far, I manged to get this:

import numpy as np
desc = np.dtype([('date', np.datetime64), ('float', np.float64)])
meanDN = np.empty([len(onlyfiles), 2], dtype = desc)

Which doesn't work when:

print(meanDN)

Why?

2
  • desc = np.dtype([('date', 'datetime64[s]'), ('float', np.float64)]) works. Commented Jun 20, 2018 at 13:33
  • Possible duplicate of Cannot populate numpy datetime64 arrays Commented Jun 20, 2018 at 13:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.