Skip to content

Make contingency table exercise do-able without needing fake-data-for-learning #18

@munichpavel

Description

@munichpavel
import xarray as xr

default_values = [0, 1]
gender_values = [0, 1]
occupation_values = [0, 1]
activity_values = [0, 1]

# without using fake-data-for-learning method
counts = [
    [
        [
            [1911.,  919.],
            [  80.,   18.]
        ],
        [
            [ 654., 2820.],
            [  35.,   64.]
        ]
    ],
    [
        [
            [   0.,    0.],
             [1641.,  288.]],
        [
            [   0.,    0.],
             [ 618.,  952.]
        ]
    ]
]
contingency = xr.DataArray(
    counts,
    dims=('default', 'gender', 'activity', 'occupation'),
    coords=dict(
        default=default_values,
        gender=gender_values,
        activity=activity_values,
        occupation=occupation_values
    )
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions