Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg.ttest() error explicitation for second set of observations (unclear UnboundLocalError) #222

Closed
Tracked by #236
AlineROC opened this issue Jan 17, 2022 · 2 comments
Assignees
Labels
docs/testing 📖 Documentation and unit testing

Comments

@AlineROC
Copy link

AlineROC commented Jan 17, 2022

Hello,

When using pg.ttest with two set of observations, the error is not explicit when the second set of observations is not valid.

pingouin.ttest(x = [] , y = [1, 2, 3] ) returns AssertionError: x must have more than one element.
pingouin.ttest(x = [1, 2, 3] , y = [] ) returns UnboundLocalError: local variable 'dof' referenced before assignment

The UnboundLocalError can be unclear for the user, maybe it would be suitable to use an AssertionError as well.

Thanks,

@raphaelvallat raphaelvallat self-assigned this Jan 17, 2022
@raphaelvallat raphaelvallat added the docs/testing 📖 Documentation and unit testing label Jan 17, 2022
@raphaelvallat
Copy link
Owner

Thanks @AlineROC! Agreed — I'll fix this in the next release of Pingouin.

@raphaelvallat
Copy link
Owner

Done in 6a74015

@raphaelvallat raphaelvallat mentioned this issue Feb 12, 2022
12 tasks
raphaelvallat added a commit that referenced this issue Feb 20, 2022
* Flake8

* Explicit error when y is an empty list in pg.ttest

#222

* Add keyword arguments in homoscedasticity function

#218

* Bugfix rm_anova and mixed_anova changed the dtypes of categorical columns + added observed=True to all groupby

#224

* Update version number in init and setup

* Use np.isclose for test_pearson == 1

#195

* Coverage for try..except scipy fallback

* Fix set_option for pandas 1.4

* Upgraded dependencies for seaborn and statsmodels

* Added Jarque-Bera test in pg.normality

#216

* Coverage scipy import error

* Use pd.concat instead of frame.append to avoid FutureWarning

* Remove add_categories(inplace=True) to avoid FutureWarning

* GH Discussions instead of Gitter

* Minor doc fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs/testing 📖 Documentation and unit testing
Projects
None yet
Development

No branches or pull requests

2 participants