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

Sorting of to_numpy and to_pandas #379

Open
javiber opened this issue Feb 26, 2024 · 0 comments
Open

Sorting of to_numpy and to_pandas #379

javiber opened this issue Feb 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@javiber
Copy link
Collaborator

javiber commented Feb 26, 2024

These functions are not enforcing a specific sorting as discussed in #378.

Sorting by timestamp makes the most sense (IMO) but there is a case for sorting by index and then timestamp.

In [6]: evset = tp.event_set(
   ...:     timestamps=['2023-11-08T17:14:38', '2023-11-29T21:44:46'],
   ...:     features={
   ...:         "my_index": [1, 0],
   ...:     },
   ...:     indexes=["my_index"],
   ...: )
   ...: tp.to_pandas(evset)
Out[6]:
   my_index           timestamp
0         0 2023-11-29 21:44:46
1         1 2023-11-08 17:14:38

In [7]: evset = tp.event_set(
   ...:     timestamps=['2023-11-08T17:14:38', '2023-11-29T21:44:46'],
   ...:     features={
   ...:         "my_index": [0, 1],
   ...:     },
   ...:     indexes=["my_index"],
   ...: )
   ...: tp.to_pandas(evset)
Out[7]:
   my_index           timestamp
0         1 2023-11-29 21:44:46
1         0 2023-11-08 17:14:38
@javiber javiber added the enhancement New feature or request label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant