Why must x have more than one element in remove_na? #287
-
Hi, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@abarozet unless you are doing a one-sample T-test (which is not supported by pingouin.pairwise_ttests), you must have at least two valid elements in each of your group otherwise the T value and p-value cannot be calculated. Example using SciPy: from scipy.stats import ttest_ind
ttest_ind([1], [2, 3, 4]) # Will return NaN and print a RuntimeWarning
ttest_ind([2, 3, 4], 1) # Same
ttest_ind(1, 1) # Same |
Beta Was this translation helpful? Give feedback.
-
That said, we could remove the assertion check in pingouin.remove_na to avoid raising an error when x is empty or has a single element pg.remove_na([]) # AssertionError
pg.remove_na(np.array([1])) # AssertionError |
Beta Was this translation helpful? Give feedback.
@abarozet unless you are doing a one-sample T-test (which is not supported by pingouin.pairwise_ttests), you must have at least two valid elements in each of your group otherwise the T value and p-value cannot be calculated.
Example using SciPy: