Comments (2)
I found a work around for now. It would seem that NoneType
is produced probably when data is not present for the time interval being merged and aggregated. Passing in a custom aggregate function that forces NoneType
to 0
worked for me:
import traces
def custom_func(x):
x_fillna = [i if i else 0 for i in x]
return sum(x_fillna)
ts = [traces.TimeSeries(), traces.TimeSeries()]
ts[1][2] = 3
traces.TimeSeries.merge(ts, operation=custom_func)
from traces.
@ThomDietrich thanks for opening this issue! It's a great idea to improve the documentation about this.
(The Exception is the desired behavior in this case. The first time series has the default value None
for all times, and the second is None
for all times before 2, and then 3 afterwards. At, for example, t=4, merge
with operation=sum
is summing None + 3
, and does not automatically assume that Nones should be ignored).
Thanks @tasq-inc for posting a solution. This solution or something similar is exactly what I'd suggest using if you want to ignore Nones.
from traces.
Related Issues (20)
- pd.NaT creates unexpected behavior in TimeSeries
- tests fail because of something with config
- TimeSeries._get_linear_interpolate() explicitly casts int to float HOT 2
- Result of to_bool is missing default value assignment HOT 2
- will it work for multivariate time series prediction both regression and classification HOT 1
- Where is the folder called "data" containing the 40 times series ? HOT 1
- [... list of forty traces.TimeSeries ...] is not functioning. HOT 2
- Incorrect handling of Numpy array passed as times of measurements HOT 1
- No longer maintained? HOT 5
- `max` for distribution with `start` and `end` gives wrong result HOT 1
- add documentation for TimeSeries.plot
- add documentation for EventSeries
- Documentation failing HOT 1
- bool(trace) should handle default values
- use a specific value for the default when not given (e.g. NotGiven) to differentiate a default=None with a default not given HOT 2
- add default in __str__ when default is given
- support __abs__ on traces
- support all mathematical magic methods including __r*__ and __pos__/__neg__
- adding a constant to a trace fails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from traces.