Comments (6)
I have the same error, it is not posible to run the tickers and weights of a portfolio
from quantstats.
I am also encountering this issue... nothing I have done is fixing it.
from quantstats.
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.
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)
- Plots don't display when using matplotlib backend qt HOT 1
- Is this project **ABANDONED** ? HOT 1
- Asset Wise Transaction List - Profit Loss Account
- Incompatibility with AWS Lambda
- TypeError: unsupported operand type(s) for +: 'float' and 'str' HOT 3
- Warings about pd.to_timedelta
- 'TypeError: super(type, obj): obj must be an instance or subtype of type' in the super() function of reports.html HOT 1
- stats.py: res = abs(total + 1.0) ** (1.0 / years) - 1 <-- ZeroDivisionErrorZeroDivisionError HOT 1
- Deprecated code in stats.py expected_return()
- Calculation of 3Y and 5Y annualized return date lag
- report.py's cagr function doesn't include the days per year options HOT 1
- Fix kelly_criterion formula for investment scenario
- draw visuals in plotly
- Jupyter import issue: `magic(...)` is deprecated
- Cumulative Performance in reports.html does not calculate correctly HOT 4
- Generate full html_report but save as image
- Datetime issue
- "Strategy" HOT 1
- is _qtd bug ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quantstats.