summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pyisda/curve.pyx7
1 files changed, 3 insertions, 4 deletions
diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx
index a9528f7..cb20d63 100644
--- a/pyisda/curve.pyx
+++ b/pyisda/curve.pyx
@@ -83,7 +83,7 @@ cdef class Curve(object):
'data': fArray_to_list(self._thisptr.get().fArray, self._thisptr.get().fNumItems)}
@cython.boundscheck(False)
- def to_df(self):
+ def to_series(self):
cdef np.npy_intp n = self._thisptr.get().fNumItems
cdef np.ndarray[np.float64_t,ndim=1] h = np.PyArray_EMPTY(1, &n, np.NPY_DOUBLE, 0)
cdef np.ndarray[np.int64_t,ndim=1] d = np.PyArray_EMPTY(1, &n, np.NPY_INT64, 0)
@@ -91,9 +91,8 @@ cdef class Curve(object):
cdef TRatePt* it = self._thisptr.get().fArray
for i in range(n):
h[i] = it[i].fRate
- d[i] = it[i].fDate -134774
-
- return {'hazard_rates': h, 'dates':d.view('M8[D]')}
+ d[i] = it[i].fDate - 134774
+ return pd.Series(h, index=d.view('M8[D]'), name='hazard_rates')
def __iter__(self):
cdef: