fmilthaler / FinQuant

A program for financial portfolio management, analysis and optimisation.
MIT License
1.38k stars 190 forks source link

fixed #73. #75

Closed PietropaoloFrisoni closed 1 year ago

PietropaoloFrisoni commented 1 year ago

The "append" method in Pandas is deprecated since version 1.4.0.

It can still be called with the underscore prefix, which allows to easily update the code (and it goes very well with black formatter).

In future versions, it might be necessary to replace "DataFrame.append" with "Pandas.concat".

fmilthaler commented 1 year ago

Thanks for the fix. I tested it and it does work. But I'm thinking that it would probably be a good idea to use concat already.

The following should work:

self.portfolio = pd.concat(
    [self.portfolio, stock.investmentinfo.to_frame().T], ignore_index=True
)

What do you think?

fmilthaler commented 1 year ago

The formatting (3 lines) is fine. Thanks for the change.