google/temporian

Feature: tp.to_numpy()

ianspektor opened this issue ยท 9 comments

Export an EventSet to numpy arrays with tp.to_numpy(evset).

See tp.to_pandas() for reference.

The EventSet is flattened (its index is dropped and kept as features, with .drop_index(keep=True)). Returns a dictionary mapping feature names to values, + an extra "timestamps" key with the timestamps.

Provide timestamps: bool = True and timestamp_to_datetime: bool = True arguments (same as in tp.to_pandas())

This needs to be tested thoroughly, see temporian/io/test/pandas_test.py for reference.

Example:

evset = tp.event_set(
    timestamps=[0, 1, 2, 3],
    features={
        "a": ["A", "B", "A", "B"],
        "b": [4, 5, 6, 7],
    },
    indexes=["a"],
)

res = tp.to_numpy(evset)
res
{
    "timestamps": [0, 1, 2, 3],
    "a": ["A", "B", "A", "B"],
    "b": [4, 6, 5, 7],
}

Hi, I want to give this a try. Can you assign me? If your answer is yes, can you give some insights like where should I start to learn to succes on this issue?

penguins-of-madagascar-waving-hello-pb0tkzpn2x5dz3ho

Hey @Musa-Sina-Ertugrul! Have someone on Discord that wanted to take on it but hasn't started, just pinged them to see if they are OK with freeing it up, I'll let you know when they get back to me. Thanks!

Not problem If he/she wants I can work on other good first issue labels.

Hey @Musa-Sina-Ertugrul! No answer from them on Discord so it's all yours if you want it.

Thanks ๐Ÿ˜„ Yes, I want

I could not managed preparing environment sorry :( Can you give this task to someone

Hello @ianspektor
I would like to contribute to this feature, please let me know If I can start working on this. Thank you.

@Musa-Sina-Ertugrul sorry to hear that - could you open an issue with what went wrong? Both so that we can help you set it up and improve the documentation for everyone else :)

@nagavenkateshgavini sure! Let me know if you run into any issues or have any doubts. I see you've joined our Discord, feel free to write there if you prefer :) Thanks!