Last active
March 12, 2019 03:03
-
-
Save panicpotatoe/5d98c73c8673e8ad08bde4e76d41f4d5 to your computer and use it in GitHub Desktop.
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
| # STEP 2: GET THE "OBSERVED" TABLE AND "EXPECTED" TABLE | |
| """ | |
| Calculate the "observed" table: | |
| "Observed" table can be extracted from our CrossTab by exclude the row_totals and col_totals | |
| You can see row_totals is in the index of 4 (in column) | |
| and col_totals is in the index of 6 (in row). | |
| So [0:5, 0:3] means "we will take the rows from 0 index to 5 index | |
| and columns from 0 index to 3 index and assign to new CrossTab | |
| that named [observed]" | |
| """ | |
| observed = voter_tab.iloc[0:5, 0:3] | |
| # You can check the data of observed table by calling it | |
| observed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment