DABEST-python icon indicating copy to clipboard operation
DABEST-python copied to clipboard

Problem with plotting mean_diff

Open paul-hawkins opened this issue 4 years ago • 8 comments

The following code should produce two plots, but only the swarm plot is produced, and an error is thrown.

new_df = pd.read_csv('%s/all_ringrmsd_data_only.txt' % rootdir, sep='\t') s_control = db.load(new_df,idx=('OMEGA','MOE','Macromodel','Desmond','RDKit','Prime'))

s_control.cohens_d

s_control.mean_diff.plot(raw_marker_size=3)

image

IndexError: index 12 is out of bounds for size 12

all_ringrmsd_data_only.txt

paul-hawkins avatar Apr 20 '20 19:04 paul-hawkins

Hi Paul,

I am able to run your code snippet, on the data you uploaded.

I get this image.

image

Can I check: what is your DABEST version when you run

dabest.__version___

or

db.__version___

given than you import DABEST as db in your example? I'm using the latest version, DABEST v0.3.0.

josesho avatar Apr 23 '20 11:04 josesho

Hi @josesho , I have the same issue with my data: an "IndexError: index 10 is out of bounds for size 8" when running the plot function. I ran the code of @paul-hawkins and I also obtained the same error. I have DABEST 0.3.0 as well. I am using Jupyter Notebook. Note that I can have a graph for only two variables: idx=('OMEGA','MOE'), the problem appears with more than two. Dabest two variables

dhuzard avatar Apr 23 '20 14:04 dhuzard

That’s very odd, as I am using 0.3.0 too.

Paul.

From: Joses W. Ho [email protected] Sent: Thursday, April 23, 2020 5:33 AM To: ACCLAB/DABEST-python [email protected] Cc: Paul Hawkins [email protected]; Author [email protected] Subject: Re: [ACCLAB/DABEST-python] Problem with plotting mean_diff (#98)

Hi Paul,

I am able to run your code snippet, on the data you uploaded.

Can I check: what is your DABEST version when you run

dabest.version_

or

db.version_

given than you import DABEST as db in your example? I'm using the latest version, DABEST v0.3.0.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ACCLAB/DABEST-python/issues/98#issuecomment-618349651, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE6VZPUYO7EAMPJTNU4Q2NLROAROZANCNFSM4MMW7DAQ.

paul-hawkins avatar Apr 23 '20 16:04 paul-hawkins

@paul-hawkins and @dhuzard ,

This looks suspiciously like issues #67 and #70.

Could I trouble both of you to check what version of pandas you two have installed?

import pandas as pd
pd.__version__

Thanks!

josesho avatar Apr 24 '20 07:04 josesho

I found out the solution: upgrading to python 3.8 !

dhuzard avatar Apr 24 '20 07:04 dhuzard

Hi Joses,

'0.25.3'

Does updating to Python 3.8 fix the issue, as dhuzard suggested?

Paul.

From: Joses W. Ho [email protected] Sent: Friday, April 24, 2020 1:33 AM To: ACCLAB/DABEST-python [email protected] Cc: Paul Hawkins [email protected]; Mention [email protected] Subject: Re: [ACCLAB/DABEST-python] Problem with plotting mean_diff (#98)

@paul-hawkinshttps://github.com/paul-hawkins and @dhuzardhttps://github.com/dhuzard ,

This looks suspiciously like issues #67https://github.com/ACCLAB/DABEST-python/issues/67 and #70https://github.com/ACCLAB/DABEST-python/issues/70.

Could I trouble both of you to check what version of pandas you two have installed?

import pandas as pd

pd.version

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/ACCLAB/DABEST-python/issues/98#issuecomment-618854019, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE6VZPWUM4DIKTPYG67APBTROE6ENANCNFSM4MMW7DAQ.

paul-hawkins avatar Apr 24 '20 15:04 paul-hawkins

Hi, @paul-hawkins, I think upgrading pandas to >= 0.26 should do it. Can you give it a go?

josesho avatar Apr 27 '20 03:04 josesho

Upon upgrading to pandas 1.0.3 I saw this

(oepython36) C:\Users\phawkins>pip install --upgrade pandas Collecting pandas Downloading https://files.pythonhosted.org/packages/d2/81/a1514c993ad8261a2053f356c3ea9a6ad41871a09a8ef9cf46789e371a63/pandas-1.0.3-cp36-cp36m-win_amd64.whl (8.7MB) |████████████████████████████████| 8.7MB 819kB/s Requirement already satisfied, skipping upgrade: python-dateutil>=2.6.1 in c:\users\phawkins\anaconda3\envs\oepython36\lib\site-packages (from pandas) (2.8.0) Requirement already satisfied, skipping upgrade: numpy>=1.13.3 in c:\users\phawkins\anaconda3\envs\oepython36\lib\site-packages (from pandas) (1.17.2) Requirement already satisfied, skipping upgrade: pytz>=2017.2 in c:\users\phawkins\anaconda3\envs\oepython36\lib\site-packages (from pandas) (2019.2) Requirement already satisfied, skipping upgrade: six>=1.5 in c:\users\phawkins\anaconda3\envs\oepython36\lib\site-packages (from python-dateutil>=2.6.1->pandas) (1.12.0) ERROR: dabest 0.3.0 has requirement pandas!=0.25.2,~=0.25, but you'll have pandas 1.0.3 which is incompatible. Installing collected packages: pandas Found existing installation: pandas 0.25.1 Uninstalling pandas-0.25.1: Successfully uninstalled pandas-0.25.1 Successfully installed pandas-1.0.3

(oepython36) C:\Users\phawkins>

However, as you said, upgrading works! (albeit with a warning)

C:\Users\phawkins\Anaconda3\envs\oepython36\lib\site-packages\IPython\core\pylabtools.py:128: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect. fig.canvas.print_figure(bytes_io, **kw)

[cid:[email protected]] One last thing – how do I change the font size in the violin plot and the distribution plot? I see I can pass in ‘violinplot_kwargs’ but

violinplot_kwargs={'fontsize':36})

does not work. I can’t see how to go about changing the distribution plot at all.

Thanks for all the help Joses,

Paul.

From: Joses W. Ho [email protected] Sent: Sunday, April 26, 2020 9:19 PM To: ACCLAB/DABEST-python [email protected] Cc: Paul Hawkins [email protected]; Mention [email protected] Subject: Re: [ACCLAB/DABEST-python] Problem with plotting mean_diff (#98)

Hi, @paul-hawkinshttps://github.com/paul-hawkins, I think upgrading pandas to >= 0.26 should do it. Can you give it a go?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/ACCLAB/DABEST-python/issues/98#issuecomment-619688874, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE6VZPVVFE2MVQRP5XMHR2TROT2TRANCNFSM4MMW7DAQ.

paul-hawkins avatar Apr 27 '20 17:04 paul-hawkins