Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDL::DateTime #18

Closed
zmughal opened this issue May 24, 2015 · 9 comments
Closed

PDL::DateTime #18

zmughal opened this issue May 24, 2015 · 9 comments

Comments

@zmughal
Copy link
Member

zmughal commented May 24, 2015

Pandas:

df.time_col.weekday

R

?Date
?POSIXt
?weekdays
?seq.Date
@kmx
Copy link

kmx commented Aug 16, 2015

Hi Zaki,

do you have some particular ideas how PDL::DateTime should be implemented?

I am using my module (not released as it is still an ugly hack) that implements PDL::SerialDate (more or less the serial date from matlab). It basically is a PDL (Long or LongLong) with overloaded stringification (to print date) and some special constructors like new_from_ymd() and few extra methods. Now it handles only dates but I can imagine (although not tested) that with underlying PDL of type Double it might also handle date+time.

@zmughal
Copy link
Member Author

zmughal commented Aug 17, 2015

I was thinking about storing the POSIX epoch time in a subclass of PDL::Long. It would be like R's POSIXct. And it will support methods that extract out the weekday (returning a PDL::Factor subclass) or month (another PDL::Factor subclass). There may also be a method that returns a PDL::SV full of DateTime(::Tiny) instances.

@kmx
Copy link

kmx commented Aug 19, 2015

I have started some experiments. I am sub-classing PDL::LongLong internally keeping number of microseconds (positive or negative) since 1970-01-01. Microseconds might come handy when dealing with high-frequency data. LongLong enables us to handle date time range 0001-01-01 00:00:00.000000 .. 9999-12-31 23:59:59.999999 with microsecond precision.

BTW LongLong + nanosecond precision would limit us to date range 1677-09-21T00:12:44 .. 2262-04-11T23:47:15

Ad converting date time values to "some" instances - DateTime is not a good option performance-wise, Time::Moment is very promising.

@kmx
Copy link

kmx commented Aug 20, 2015

Hi Zaki,

FYI my hacking on PDL::DateTime is here

Any comments are welcome.

@zmughal
Copy link
Member Author

zmughal commented Aug 21, 2015

Cool! I'll definitely follow along!

@kmx
Copy link

kmx commented Sep 4, 2015

I have finish kind of a initial PDL::DateTime version (see my repo). It only needs PDL core with longlong-double fix

@kmx
Copy link

kmx commented Oct 5, 2015

Zaki,

I want to ask if your original plan was to have PDL::DateTime a part of Data-Frame distribution or a separate module. Is it OK for you if I release PDL::DateTime as my module to CPAN?

My plan is to wait for PDL-2.014 (longlong fixes, you know) and then release PDL::DateTime + also a new versions of PDL::IO::DBI and PDL::IO::CSV which will have a support for automatic conversion of DATETIME data to PDL::DateTime piddles.

--kmx

@zmughal
Copy link
Member Author

zmughal commented Oct 5, 2015

On 2015-10-05 at 03:56:20 -0700, kmx wrote:

Zaki,

I want to ask if your original plan was to have PDL::DateTime a part of Data-Frame distribution or a separate module. Is it OK for you if I release PDL::DateTime as my module to CPAN?

My plan is to wait for PDL-2.014 (longlong fixes, you know) and then release PDL::DateTime + also a new versions of PDL::IO::DBI and PDL::IO::CSV which will have a support for automatic conversion of DATETIME data to PDL::DateTime piddles.

A separate module is perfectly fine. I only made reference to it here
because I was going through the functionality of Pandas from Python
which includes its own time series specific data structure.

Cheers,
-- Zaki Mughal

--kmx


Reply to this email directly or view it on GitHub:
#18 (comment)

@zmughal
Copy link
Member Author

zmughal commented Jan 2, 2022

No longer needed as @kmx has released https://metacpan.org/pod/PDL::DateTime.

@zmughal zmughal closed this as completed Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants