contingency

Pd.crosstab missing data?

Pd.crosstab missing data? Question: I am using pd.crosstab to count presence/absence data. In the first column, I have several presence counts (represented by 1’s), in the second column I have just one ‘presence’. Howwever, when I run crosstab on this data that single presence in the second column isn’t counted. Could anyone shed some light …

Total answers: 1

Python/ Pandas: Making a contingency table with multiple variables

Python/ Pandas: Making a contingency table with multiple variables Question: My dataframe has 4 columns (one dependent variable and 3 independent). Here’s a sample: My desired output is a contingency table, as follows: I can only seem to get a contingency table using one independent variable- using the following code (my df is called ‘table’) …

Total answers: 2