t-test where one sample has zero variance? I'm very rusty on statistics, so go easy on me haha.
I'm trying to compare two sample sets of values to see if there is any significance difference between the two means. From memory, an unpaired t-test should be able to do this? The issue is that one set has zero variance, so do I use an equal variance test or an unequal?
If there's a better test for this then feel free to let me know :)




Group 1
Group 2




3.97
4.00


3.63
4.00


3.63
4.00


4.00
4.00


4.29
4.00


3.95
4.00


3.63
4.00


3.63
4.00


3.63
4.00


3.96
4.00


3.63



4.00



3.63



3.63



3.93



3.97



4.00



3.63



4.00



3.92



4.26



4.08



3.43



4.26



4.17



3.63





As others have already said, it would be better to address the issue with rounding to get the original data. However, if you have to work with the data you have here's another fairly simple option that may have some advantages over current answers:
Do a t-test under the assumption of equal variance where the variance is calculated using only Group 1. Basically, using the procedure for unequal sample sizes, similar variances but replacing the variance of group 2 ($s^{2}_{X_{2}}$ on the wiki page) with the variance of group 1 ($s^{2}_{X_{1}}$).
You would have to do this by hand but it's should be doable even in e.g. Excel if you don't have much experience with software like R or python.
I think the problem with pre-packaged t-test either assuming equal or unequal variance is that Group 2 is going to bias downwards the estimate of variance (assuming you don't believe Group 2 has 0 variance). Similarly, testing Group 1 against a fixed mean of 4 (like t.test(Group_1, mu=4)) ignores the variance in Group 2.
More sophisticated solutions based on re-sampling, Bayesian statistics, etc (see @AdamO answer) may be better but more difficult to implement.

Sextus Empiricus in comment says:

If group2 has an unexpectedly low variance, then it is arbitrary to just decide to replace it with the variance of group 1

I'd say that eventually every analysis has some arbitrary elements. The question is how you justify them and how they impact the interpretation.
My suggestion assumes that the lack of variation in group 2 is unrealistic and all data points have been reset to 4.00. In such case, I think using the variance from group 1 is more sensible than taking the values in group 2 at face value or, equivalently, testing if group 1 differs from the point value of 4.00. I think it is more reasonable to assume that different farms have more or less the same variance than assuming no variance at all. I guess you could even present results for a range of variances for group 2 (from no variance to the same variance of group 1) and make an informed decision based on that.
In the end it's up to the OP to decide what assumptions are more sensible and make sure that collaborators are aware of those decisions. I would also consider whether it is more costly a false positive (claim farms are different when they are not) or a false negative (farms are indistinguishable when instead they are).
