Comments (9)
Closed with #89
from dabest-python.
Hello, FYI, this is not an issue causes by dabest.
Something is broken while Cythonizing the groupby.quantile
in the version 0.25
of Pandas
.
pandas-dev/pandas#20405 (comment)
pandas-dev/pandas#27526 (comment)
I believe the best solution, in short term, is to force people stay at 0.24
from dabest-python.
I also see this error, after upgrading to pandas==0.25
.
The last traceback pointing to dabest
is
~/anaconda3/envs/bleeding-edge/lib/python3.7/site-packages/dabest/plot_tools.py in gapped_lines(data, x, y, type, offset, ax, line_color, gap_width_percent, **kwargs)
160
161 medians = data.groupby(x)[y].median().reindex(index=group_order)
--> 162 quantiles = data.groupby(x)[y].quantile([0.25, 0.75])\
163 .unstack()\
164 .reindex(index=group_order)
Something has changed in df.groupby().quantile()
. I will let you know when this is fixed. If you squash this earlier, feel free to do a pull request!
Thanks,
Joses
from dabest-python.
Ah ok, thanks @BioinfoTongLI for following this up! Let's wait for pandas=0.25.1
to be released.
from dabest-python.
Just to add that I am still getting an error (albeit different from OP) with pandas 0.25.1
and dabest 0.2.4
running the iris example in the README:
In [6]: iris_dabest.mean_diff.plot();
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-6-be7fec275da2> in <module>
----> 1 iris_dabest.mean_diff.plot();
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/dabest/_classes.py in plot(self, color_col, raw_marker_size, es_marker_size, swarm_label, contrast_label, swarm_ylim, contrast_ylim, custom_palette, swarm_desat, halfviolin_desat, halfviolin_alpha, float_contrast, show_pairs, group_summaries, group_summaries_offset, fig_size, dpi, swarmplot_kwargs, violinplot_kwargs, slopegraph_kwargs, reflines_kwargs, group_summary_kwargs, legend_kwargs)
1233 del all_kwargs["self"]
1234
-> 1235 out = EffectSizeDataFramePlotter(self, **all_kwargs)
1236
1237 return out
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/dabest/plotter.py in EffectSizeDataFramePlotter(EffectSizeDataFrame, **plot_kwargs)
375 gap_width_percent=1.5,
376 type=group_summaries, ax=rawdata_axes,
--> 377 **group_summary_kwargs)
378
379
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/dabest/plot_tools.py in gapped_lines(data, x, y, type, offset, ax, line_color, gap_width_percent, **kwargs)
160
161 medians = data.groupby(x)[y].median().reindex(index=group_order)
--> 162 quantiles = data.groupby(x)[y].quantile([0.25, 0.75])\
163 .unstack()\
164 .reindex(index=group_order)
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/groupby/groupby.py in quantile(self, q, interpolation)
1951 indices = np.concatenate(arrays)
1952 assert len(indices) == len(result)
-> 1953 return result.take(indices)
1954
1955 @Substitution(name="groupby")
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/series.py in take(self, indices, axis, is_copy, **kwargs)
4430
4431 indices = ensure_platform_int(indices)
-> 4432 new_index = self.index.take(indices)
4433
4434 if is_categorical_dtype(self):
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/indexes/multi.py in take(self, indices, axis, allow_fill, fill_value, **kwargs)
2030 allow_fill=allow_fill,
2031 fill_value=fill_value,
-> 2032 na_value=-1,
2033 )
2034 return MultiIndex(
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/indexes/multi.py in _assert_take_fillable(self, values, indices, allow_fill, fill_value, na_value)
2058 taken = masked
2059 else:
-> 2060 taken = [lab.take(indices) for lab in self.codes]
2061 return taken
2062
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/indexes/multi.py in <listcomp>(.0)
2058 taken = masked
2059 else:
-> 2060 taken = [lab.take(indices) for lab in self.codes]
2061 return taken
2062
IndexError: index 6 is out of bounds for size 6
from dabest-python.
@josesho It's my bad, I shouldn't close this...
I thought it will be solved rapidly...
Clearly it is not the case. I saw the issues is closed in pandas
repo.
Someone can try a nightly build of pandas
to see if it works?
from dabest-python.
The pandas developers tried a patch with 0.25.1
, but there's still a problem...
I've opened an issue with them pandas-dev/pandas#28312.
I think the best option for now is to stick with pandas==0.24
.
from dabest-python.
this seems to work with pandas 0.25.3 (pandas issue reckons it was fixed back in .2 but I haven't tested that). Any chance of relaxing the version restriction?
from dabest-python.
Hi @akdor1154, sorry for the delay; I just got back in the office. Thanks for the heads-up, I'll check out the latest pandas version and fix it ASAP over Christmas break
from dabest-python.
Related Issues (20)
- color_col formatting HOT 2
- pandas version conflicts HOT 2
- Plot ONLY mean diff HOT 1
- Error with dataframes containing non-string column names HOT 3
- Is it possible to get access to the underlying bootstrap samples generated to obtain the 95% CI for ES? HOT 1
- cannot plot the figures HOT 3
- Estimation plot only HOT 1
- Warning: Not all points displayed... HOT 2
- Are multi-group p-values corrected for multiple comparisons? HOT 2
- contrast_ylim does not work for matplotlib HOT 1
- DABEST calculation of median difference CIs often fails HOT 5
- Error in bca.ci(boot.out, conf, index[1L], L = L, t = t.o, t0 = t0.o, : estimated adjustment 'a' is NA HOT 1
- New Release: v2023.02.14
- Error in changing the the linewidth of the lines used to join each pair of observations HOT 1
- Possibility to do mixed model statistics ? HOT 2
- Little problems with the plots HOT 3
- Limitation of paired analysis: Statistics comparing to only one group instead of with each other
- delta_g does not plot together with hedges_g
- Options for plot appearance HOT 2
- cannot plot figure - 'numpy.ndarray' object has no attribute 'categories' HOT 2
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 dabest-python.