On Wednesday 30 July 2008 13:16:25 Francesc Alted wrote: > A Wednesday 30 July 2008, Pierre GM escrigué: > > It's just that I have trouble understanding the > > meaning of something like > > t2 = numpy.ones(5, dtype="datetime64[s]") > > > > That's five times one second after the epoch, right ? But in what > > circumstances would you need t2 ? > > I'm not sure I follow you. This is just an example so as to produce an > array of time objects quickly. > ... > When you don't need the values for some > examples, conciseness is a virtue.
I'd prefer something like np.range(5, dtype=datetime64['s']), which is both concise and still has a physical meaning I can wrap my mind around. Which brings me to another question: datetime64 and timedelta64 are just dtypes, therefore they don't impose any restriction (in terms of uniqueness of elements, ordering of the elements...) on the underlying ndarray, right ? _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion