REF: Add Straetgy.data.<array>.to_series() method

This commit is contained in:
Kernc
2019-01-15 11:30:02 +01:00
parent 7711732612
commit b157c48a3c
6 changed files with 16 additions and 14 deletions

View File

@@ -2,6 +2,7 @@
from numbers import Number
import numpy as np
import pandas as pd
def _as_str(value):
@@ -52,6 +53,9 @@ class _Array(np.ndarray):
except IndexError:
return super().__float__()
def to_series(self):
return pd.Series(self, index=self._opts['data'].index, name=self.name)
class _Indicator(_Array):
pass