I'm using kaggle to test my strategies on the cloud.
Today an error occurs:
KeyError: "cannot represent labeled-based slice indexer for coordinate 'time' with a slice over integer positions; the index is unsorted or non-unique"
Then I check the installation of the packages. I found that pandas 1.2.5 was not successfully installed, which cause the error.
The error results from the wrong version of pandas, but I cannot install pandas 1.2.5, so I cannot fix the error.
Does anyone know how to install pandas 1.2.5 on kaggle?
I may need some help from @support
Thx very much
Best posts made by omohyoid
-
I cannot install pandas 1.2.5
Latest posts made by omohyoid
-
RE: ERROR! The max exposure is too high
@vyacheslav_b Thanks for ur help!
- I checked my code, and I found that I loaded the data by using load_spx_data() instead of load_ndx_data()
But I added the next trading date to the original data in order to write the latest weight. Does this operation cause the warning? - I checked the dataframe of the final weights, and I use the MAX() and the MIN() in excel to check the maximum and the minimum value of the weights, the maximum weight is 0.05, and the minimum weight is -0.05, which is different from the value 0.05882353 showing on the screen.
- I checked my code, and I found that I loaded the data by using load_spx_data() instead of load_ndx_data()
-
ERROR! The max exposure is too high
@support
After I tested my strategy,
I got the warnings below:
It stated that:- WARNING! The kind of the data and the output are different.
The kind of the data is None and the kind of the output is stocks_s&p500
The output will be cleaned with the data kind. - ERROR! The max exposure is too high.
Max exposure: [0.05555556 0.05555556 0.05555556 ... 0.05882353 0.05882353 0.05882353] Hard limit: 0.1
Use qnt.output.cut_big_positions() or normalize_by_max_exposure() to fix.
Do I need to fix the exposure? Exposure of 0.0588 is below the hard limit 0.1, so it seems that I don't need to decrease the current weights. Am I correct?
BTW, can I just ignore the warning " WARNING! The kind of the data and the output are different." ?
I don't know what should I fix according to this warning. - WARNING! The kind of the data and the output are different.
-
Can I use astronomical data as features for my machine learning model?
@support I know it sounds strange, but I want to use the distances between the sun and moon and related astronomical data for each trading day as features for my model. The data sources are obtained through mathematical calculations using an open-source Python module, rather than through web scraping.
Here is the link to this Python open-source module.
https://rhodesmill.org/skyfield/ -
RE: QNT failed to load data after 2006-01-01
@support I got it. Thanks for ur reply
-
QNT failed to load data after 2006-01-01
I submitted my strategy
but it failed due to data loading from qnt
the output shows that the data loading from qnt ranges from 2004-11-01 to 2005-12-30
the code I submitted is:
start_date, end_date, prepare_date = '2006-01-01', datetime.now().strftime('%Y-%m-%d'), '2004-11-01'
data = qndata.stocks_load_spx_data(min_date = prepare_date, max_date = end_date)
but qnt didn't load the data after 2006-01-01
@support
I would like to know how to fix the problem
-
Can't download assets
After I upgrade to the latest version of qnt library(0.0.406)
An error appears
"Exception: can't download assets"
@support Is there a bug in the latest version of qnt?

-
RE: How to turn off "WARNING: some dates are missed in the portfolio_history"
@support Thanks for ur help
Is there a way to turn off the warning from the outside of the qnt module? I hope that I can just add a line in my strategy code to call something in the qnt module to remove the warning. -
How to turn off "WARNING: some dates are missed in the portfolio_history"
I'm using partial data for testing the performance for machine learning models.
qnt module outputs such warning:
WARNING: some dates are missed in the portfolio_history
I'd like to turn off this warning
But I don't know how to do
Can @support give an example for how to turn off this specific warning?