Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

ImportError: cannot import name 'qqplot' from 'seaborn_qqplot' (C:\Python37\lib\site-packages\seaborn_qqplot\__init__.py) #15

Closed
vinuthna91 opened this issue Jul 28, 2020 · 6 comments

Comments

@vinuthna91
Copy link

vinuthna91 commented Jul 28, 2020

Hi, I tried installing seaborn-qqplot using below command
python3 -m pip install seaborn-qqplot.

Installation was successful.
When I try "import seaborn_qqplot" on python3 terminal, there is no error. However, when I try "from seaborn_qqplot import qqplot", it throws me import error. Kindly help resolve this!

@vinuthna91 vinuthna91 changed the title Import error: ImportError: cannot import name 'qqplot' from 'seaborn_qqplot' (C:\Python37\lib\site-packages\seaborn_qqplot\__init__.py) ImportError: cannot import name 'qqplot' from 'seaborn_qqplot' (C:\Python37\lib\site-packages\seaborn_qqplot\__init__.py) Jul 28, 2020
@RonsenbergVI
Copy link
Owner

Hello,

My apologies, the documentation is not up to date yet. I'll fix that today. In the meantime have a look at the example notebook:

https://github.com/RonsenbergVI/seaborn-qqplot/blob/master/examples/example.ipynb

It explains the new API. I have consolidated all methods in the same method:

from seaborn_qqplot import pplot

the pplot kw argument 'kind' will help you select the type of probability plot you want to show:

  • 'q' : quantile plot (i.e. empirical values against empirical quantile function) - univariate
  • 'p' : probability plot (i.e. empirical values against cumulative distribution function) - univariate
  • 'qq': quantile function against quantile function - bivariate
  • 'pp': cumulative distribution function against cumulative distribution function - bivariate

I am also working on a blog post on the topic. I'll add all of these in there when done (hopefully by the end of the week)

If you have any other question do not hesitate, happy to help.

Rene-Jean.

@vinuthna91
Copy link
Author

Thanks for the quick reply.
I want to compare against the normal quantiles. Hence, can I use kind="qq" ?

@RonsenbergVI
Copy link
Owner

Yes do kind='qq'. If you want to compare against a specific distribution you need a scipy.stats.rv_continuous object. The basic code should be:

from seaborn_qqplot import pplot
from scipy.stats import norm


pplot(dataframe, x="your_column", kind='qq', y=norm)

@vinuthna91
Copy link
Author

Great, Thanks a lot for the quick help!

@vinuthna91
Copy link
Author

Can you give other options that can be passed to pplot?

@RonsenbergVI
Copy link
Owner

I updated the recommendation, it took a bit longer that expected. I hope it still helps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants