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

ValueError: start can't be >= end (level_cum_sum >= level_cum_sum) #123

Open
JannisWalkKIT opened this issue May 21, 2017 · 2 comments
Open

Comments

@JannisWalkKIT
Copy link

JannisWalkKIT commented May 21, 2017

Hi,

i want to use traces to convert an unevenly spaced Time Series to an evenly spaced one (like the example in the docs). When doing this the following error is raised:
"ValueError: start can't be >= end (level_cum_sum >= level_cum_sum)"

My TimeSeries looks like below when i print it to the console 1. Thus level_cum_sum is ordered and i removed duplicates.

The line raising the error is:
"regular = time_series.moving_average(10, pandas = True)"

I assume there is an error on my side, not a bug. The error message does not help myself much (more or less new to Python, but experienced in other languages).

Any help would be much appreciated.

Best regards,
Jannis

SortedDict(None, 1000, {'level_cum_sum': lagHoursCorrectedCumSum
4.730833 10.0
8.776111 20.0
8.882778 30.0
10.854722 40.0
12.983611 50.0
13.745000 53.0
17.923889 63.0
20.740833 69.0
20.747500 70.0
24.512500 73.0
25.074167 74.0
30.734722 84.0
32.031944 94.0
32.270556 100.0
36.824722 110.0
37.970278 120.0
38.818889 122.0
40.390278 132.0
41.816944 142.0
42.810833 145.0
45.745278 155.0
46.010278 157.0
46.018889 158.0
48.935000 168.0
50.605000 178.0
51.175000 188.0
52.663889 198.0
52.685000 200.0
56.738611 208.0
61.617222 218.0
...
419.344444 1550.0
423.516667 1560.0
426.186389 1569.0
427.395000 1579.0
429.465556 1589.0
429.522222 1590.0
429.528333 1591.0
430.611111 1601.0
435.259722 1611.0
436.240278 1621.0
438.515278 1630.0
439.875833 1640.0
441.641111 1650.0
443.168056 1656.0
443.173611 1657.0
448.372222 1667.0
451.460833 1677.0
454.263333 1687.0
465.015000 1697.0
468.279722 1706.0
471.472222 1716.0
473.009444 1724.0
473.701389 1727.0
473.785833 1728.0
478.067500 1738.0
483.246389 1748.0
484.898333 1758.0
485.238056 1768.0
488.893611 1778.0
488.960278 1780.0
Name: level_cum_sum, dtype: float64})

@stringertheory
Copy link
Owner

Thanks for asking the question! That is indeed a cryptic error message.

It looks like the error is due to having a mix of strings and floats as the "measurement points" in the time series: you mostly have floats as the time points, but have one time point in the TimeSeries set as the string "level_cum_sum".

If you could attach the code that you used to generate the time series, I'd be happy to take a look.

@JannisWalkKIT
Copy link
Author

Hi Mike,
thanks for the quick response!

I guess the Preprocessing should not be relevant, so here is the part just before the call leading to the error:

**levels.to_excel('levels.xlsx')

print type(levels)
print levels.dtypes

time_series = traces.TimeSeries(data=levels)
regular = time_series.moving_average(10, pandas = True)
print regular**

print type level returns <class 'pandas.core.frame.DataFrame'>
print levels.dtypes returns level_cum_sum float64

I attached the levels DataFrame as xlsx-File:
levels.xlsx

Does that help or do you need more information?

Best regards,
Jannis

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