Giter Site home page Giter Site logo

Comments (2)

ssanderson avatar ssanderson commented on August 22, 2024

@twiecki cum_returns appears to work fine for me on master:

In [16]: data = pd.DataFrame({'a': np.full(10, 0.1), 'b': np.full(10, 0.15)})

In [17]: data
Out[17]:
     a     b
0  0.1  0.15
1  0.1  0.15
2  0.1  0.15
3  0.1  0.15
4  0.1  0.15
5  0.1  0.15
6  0.1  0.15
7  0.1  0.15
8  0.1  0.15
9  0.1  0.15

In [18]: cum_returns(data)
Out[18]:
          a         b
0  0.100000  0.150000
1  0.210000  0.322500
2  0.331000  0.520875
3  0.464100  0.749006
4  0.610510  1.011357
5  0.771561  1.313061
6  0.948717  1.660020
7  1.143589  2.059023
8  1.357948  2.517876
9  1.593742  3.045558

Is the issue here with cum_returns_final? That does indeed appear to return a scalar for me:

In [20]: cum_returns_final(data)
Out[20]: 9.493134873891622

from empyrical.

twiecki avatar twiecki commented on August 22, 2024

Is the issue here with cum_returns_final? That does indeed appear to return a scalar for me:

Yes, indeed.

from empyrical.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.