Giter VIP home page Giter VIP logo

Comments (6)

FPALMAG avatar FPALMAG commented on June 4, 2024 1

I have the same error, it is not posible to run the tickers and weights of a portfolio

from quantstats.

benjoergens avatar benjoergens commented on June 4, 2024

I am also encountering this issue... nothing I have done is fixing it.

from quantstats.

baobach avatar baobach commented on June 4, 2024

Can you use a different way to generate the dictionary?
try

IAC = dict(SPY = 1.3, AGG = -0.3)

Also it would be useful if you can copy the output error code as a text and paste it in here.

from quantstats.

benjoergens avatar benjoergens commented on June 4, 2024

Can you use a different way to generate the dictionary? try

IAC = dict(SPY = 1.3, AGG = -0.3)

Also it would be useful if you can copy the output error code as a text and paste it in here.

I tried generating the dict as above, but to no avail... Here is my error code as text:

/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/quantstats/utils.py:379: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.
rbdf = index.resample(rebalance).first()
Traceback (most recent call last):
File "/Users/benjoergens/PycharmProjects/Assignment/Assignment.py", line 117, in
qs.utils.make_index(strategy)
File "/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/quantstats/utils.py", line 400, in make_index
return index[index.index <= last_day].sum(axis=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/pandas/core/frame.py", line 11670, in sum
result = super().sum(axis, skipna, numeric_only, min_count, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/pandas/core/generic.py", line 12506, in sum
return self._min_count_stat_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/pandas/core/generic.py", line 12489, in _min_count_stat_function
return self._reduce(
^^^^^^^^^^^^^
File "/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/pandas/core/frame.py", line 11562, in _reduce
res = df._mgr.reduce(blk_func)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/pandas/core/internals/managers.py", line 1500, in reduce
nbs = blk.reduce(func)
^^^^^^^^^^^^^^^^
File "/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/pandas/core/internals/blocks.py", line 404, in reduce
result = func(self.values)
^^^^^^^^^^^^^^^^^
File "/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/pandas/core/frame.py", line 11481, in blk_func
return op(values, axis=axis, skipna=skipna, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/pandas/core/nanops.py", line 85, in _f
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/pandas/core/nanops.py", line 404, in new_func
result = func(values, axis=axis, skipna=skipna, mask=mask, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/pandas/core/nanops.py", line 477, in newfunc
return func(values, axis=axis, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/pandas/core/nanops.py", line 646, in nansum
the_sum = values.sum(axis, dtype=dtype_sum)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/benjoergens/PycharmProjects/Assignment/.venv/lib/python3.12/site-packages/numpy/core/_methods.py", line 49, in _sum
return umr_sum(a, axis, dtype, out, keepdims, initial, where)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unsupported operand type(s) for +: 'float' and 'str'

from quantstats.

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.