samedi 30 juillet 2016

unpack tuple containing datetime

I have a function f(date, level), I want to unpack arguments from a numpy.record or a tuple

print(tuple(row))
(datetime.datetime(2016, 6, 17, 18, 57, 00), 123)

but

print(*tuple(row))
2016-06-17 18:57:00 123

which is 3 arguments to my function, so error.
how to keep first tuple element as datetime object ?

Aucun commentaire:

Enregistrer un commentaire