Created
October 13, 2019 12:15
-
-
Save MariaLavrovskaya/a657f9bc8db84470f12ade2ac9d47554 to your computer and use it in GitHub Desktop.
airbnb_10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from scipy import stats | |
| ## Compare with the critical t-value | |
| #Degrees of freedom | |
| df = 2*22326 - 2 | |
| print(df) | |
| #p-value after comparison with the t | |
| p = 1 - stats.t.cdf(t,df=df) | |
| print("t = " + str(t)) | |
| print("p = " + str(2*p)) | |
| ## Cross Checking with the internal scipy function | |
| t2, p2 = stats.ttest_ind(entire_subset['minimum_nights'],private_room['minimum_nights']) | |
| print("t = " + str(t2)) | |
| print("p = " + str(p2)) | |
| ### If the p-value is less than 0.05, we reject the null hypothesis | |
| ###that there's no difference between the means and conclude that a | |
| ###significant difference does exist. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment