Giter VIP home page Giter VIP logo

Comments (5)

dcajasn avatar dcajasn commented on May 24, 2024

Hi @feribg,

About your questions, well I chose pd.series since I added w_max and w_min parameters because it is easier to work with them when we use Graph based portfolio models. After check your code, there is no bug on Riskfolio-lib, the problem is in the pd.Series constraints you created.

Best,
Dany

from riskfolio-lib.

feribg avatar feribg commented on May 24, 2024

@dcajasn what is the problem how should those be created i get errors in both cases when the index is a sequence (0, len) and when the index is the list of assets. So how should those be constructed? When the index is a sequence the error is the assets are not in the index, when its the assets the error is the the sequence is not in the asset list...

One thing worth pointing out is that my assets are integer IDs and not strings.

from riskfolio-lib.

dcajasn avatar dcajasn commented on May 24, 2024

Check your code (list() is not a ps.Series method). There is no problems with Riskfolio-Lib. Use hrp_constraints function to build constraints.

from riskfolio-lib.

feribg avatar feribg commented on May 24, 2024

This is a superficial example the real code uses columns.tolist() etc. I literally copied the code in when w_max is none.

My w_max and min look exactly like the output described here https://riskfolio-lib.readthedocs.io/en/latest/constraints.html it's an index of asset Ids (integers) and a fixed value for all assets. I will add a mini example to see how it fails. Do you expect the index to be string? I think this is where things go wrong if its integer you assume positional index although i cant see where in the code that happens...

from riskfolio-lib.

dcajasn avatar dcajasn commented on May 24, 2024

All indexes and column names in pandas series and dataframes must be strings.

from riskfolio-lib.

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.