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

Pandas Support #36

Open
tylerwmarrs opened this issue Dec 2, 2017 · 3 comments
Open

Pandas Support #36

tylerwmarrs opened this issue Dec 2, 2017 · 3 comments

Comments

@tylerwmarrs
Copy link

I am interested in your module, however I noticed that it doesn't support Pandas dataframes out of the box. Would you mind explaining the reasoning behind this? Also - I could potentially add this capability. However, I am trying to understand any potential pitfalls.

Thanks in advance. Great work.

@RiteshMaheshwari
Copy link
Contributor

No pitfalls that I can think of. Feel free to add this.

@dipanjanS
Copy link

I think we need this, especially if I want to leverage pandas timeseries (Series) objects. Right now facing issues trying to get my time series objects into the APIs from this library. Any good documentation available for the time being? The default one doesn't seem exhaustive enough.

@tylerwmarrs
Copy link
Author

tylerwmarrs commented Feb 2, 2018

@dipanjanS Here is a code snippet that transforms a pandas time series to a luminol time series. I hope it helps.

import pandas as pd
import numpy as np
import luminol
from luminol.modules.time_series import TimeSeries
from luminol.utils import to_epoch

# generate random time series in pandas
rng = pd.date_range('1/1/2011', periods=72, freq='H')
ts = pd.Series(np.random.randn(len(rng)), index=rng)

# transform index values to epoch time
ts.index = ts.index.map(lambda d: to_epoch(str(d)))
lts = TimeSeries(ts.to_dict())

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

3 participants