You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Missing functionality
Although adding or multiplying a scalar value to every entry in a TimeSeries instance is very easy, when it comes to more complex element-wise operations (e.g. taking the sine function value of every entry in the series) there is no easy way to create a new TimeSeries instance, given a TimeSeries instance and operation.
Proposed solution
The most straight-forward way to implement this functionality would be implement a map function that takes as arguments a TimeSeries and a function, and returns a new TimeSeries instance (pretty much like the built-in python function).
The text was updated successfully, but these errors were encountered:
* Implement map method for TimeSeries
An implementation for map is added. It uses pandas' applymap method.
A jupyter notebook to show the tests conducted.
Resolves: #121
* Remove test_map jupyter notebook
* Add unit tests for and check within map method
Unit tests test_map.py added.
Included a small check, that the indices are in a valid range, in map method in TimeSeries class.
* Make minor adjustments to map method
Following hrzn's advice, various minor adjustments were made:
* Correct various spacing/wording inconsistencies
* Move contents of test_map.py into test_timeseries.py
* Added sanity test case to tests for map
* Changed type hints to np.number
* Removed an unncessary call to self.pd_dataframe()
* Replace self.pd_dataframe with self._pd in map method
* Add ticks to map method docstring
Missing functionality
Although adding or multiplying a scalar value to every entry in a TimeSeries instance is very easy, when it comes to more complex element-wise operations (e.g. taking the sine function value of every entry in the series) there is no easy way to create a new TimeSeries instance, given a TimeSeries instance and operation.
Proposed solution
The most straight-forward way to implement this functionality would be implement a
map
function that takes as arguments a TimeSeries and a function, and returns a new TimeSeries instance (pretty much like the built-in python function).The text was updated successfully, but these errors were encountered: