Giter VIP home page Giter VIP logo

Comments (22)

chenyispace avatar chenyispace commented on May 12, 2024 4

encountering the same issue. Can kindly explain how you resolved it? thanks

from quantstats.

ranaroussi avatar ranaroussi commented on May 12, 2024

Try cleaning up your data before using it, using:

import numpy as np
import quantstats as qs

your_data = your_data.replace([np.inf, -np.inf, -0], 0)

qs.plots.snapshot(your_data)

Let me know if that works out πŸ˜‰

from quantstats.

aa-gamJain avatar aa-gamJain commented on May 12, 2024

Not worked.

There are no infinity values in the data

from quantstats.

ranaroussi avatar ranaroussi commented on May 12, 2024

Can you re-upload your data? I seem to be corrupted...

from quantstats.

aa-gamJain avatar aa-gamJain commented on May 12, 2024

https://drive.google.com/open?id=1XN3wfOiFFGVJop6SkephKzUeUKjhqK6H

from quantstats.

ranaroussi avatar ranaroussi commented on May 12, 2024

Upgrade to the latest version and try again.

$ pip install quantstats -U --no-cache-dir

from quantstats.

aa-gamJain avatar aa-gamJain commented on May 12, 2024

Still same error

from quantstats.

ranaroussi avatar ranaroussi commented on May 12, 2024

Running this code works ok for me:

import pandas as pd
import quantstats as qs

df = pd.read_csv('test.csv', names=['date', 'price'], 
                 index_col=['date'], parse_dates=['date'])[100:]
df['returns'] = df['price'].pct_change().fillna(0)

qs.plots.snapshot(df['returns'])

Result is below:
Unknown

from quantstats.

ranaroussi avatar ranaroussi commented on May 12, 2024

If you're using jupyter - try reloading retarting the notebook kernel and import the libraries again to make sure you're using the latest version.

from quantstats.

aa-gamJain avatar aa-gamJain commented on May 12, 2024

Not working in: qs.reports.full()

from quantstats.

ranaroussi avatar ranaroussi commented on May 12, 2024

Can you post the entire code you're using? I've tested every method and eveything works.

from quantstats.

aa-gamJain avatar aa-gamJain commented on May 12, 2024

`df = pd.read_csv('test.csv', names=['date', 'price'], index_col=['date'], parse_dates=['date'])[100:]
df['returns'] = df['price'].pct_change().fillna(0)

qs.plots.snapshot(df['returns']) # Works

qs.reports.full(df['returns'] , "SPY") # return error`

ValueError: cannot convert float NaN to integer

from quantstats.

aa-gamJain avatar aa-gamJain commented on May 12, 2024

image

Can you share which version of pandas and numpy are you using?

If you check the picture it won't able to plot Rolling Beta to Benchmark

from quantstats.

ranaroussi avatar ranaroussi commented on May 12, 2024

Upgrade to the latest version and try again. Again :)

$ pip install quantstats -U --no-cache-dir

from quantstats.

aa-gamJain avatar aa-gamJain commented on May 12, 2024

I upgraded again. Restart the jupyter notebook and still the same error.

By error it looks there is some error in plot_rolling_beta function

from quantstats.

aa-gamJain avatar aa-gamJain commented on May 12, 2024

mmin = min([-100, int(beta.min()*100)])
In this line beta.min() returning NaN so it cannot convert NaN to integer. Can you please check?

from quantstats.

ranaroussi avatar ranaroussi commented on May 12, 2024

from quantstats.

aa-gamJain avatar aa-gamJain commented on May 12, 2024

I run the pip install quantstats -U --no-cache-dir

still its 0.0.19

from quantstats.

aa-gamJain avatar aa-gamJain commented on May 12, 2024

I fixed it out. Thank you very much :)

from quantstats.

ranaroussi avatar ranaroussi commented on May 12, 2024

πŸ‘πŸ»

from quantstats.

ranaroussi avatar ranaroussi commented on May 12, 2024

πŸ‘πŸ»

from quantstats.

Onepamopa avatar Onepamopa commented on May 12, 2024

BTW, the error still occurs, I'm investigating further and will provide more details when I have them.

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.