Skip to content

Instantly share code, notes, and snippets.

@mixmixmix
Last active May 20, 2020 20:18
Show Gist options
  • Select an option

  • Save mixmixmix/6f9205d17f5ad19207e2c5431176a86d to your computer and use it in GitHub Desktop.

Select an option

Save mixmixmix/6f9205d17f5ad19207e2c5431176a86d to your computer and use it in GitHub Desktop.

Revisions

  1. mixmixmix revised this gist May 20, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion data example
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,6 @@ print(dataset)

    #Add a row with aggregated values from all regions

    #calculate and display mean values for each numerical column (cases, population, cases per 10 000 population)
    #calculate and display average values for each column (cases, population, cases per 10 000 population)

    #print the table
  2. mixmixmix revised this gist May 20, 2020. 1 changed file with 1 addition and 5 deletions.
    6 changes: 1 addition & 5 deletions data example
    Original file line number Diff line number Diff line change
    @@ -2,14 +2,10 @@ import pandas as pd
    datadict = {'region': {0: 'Region A', 1: 'Region B', 2: 'Region C', 3: 'Region D', 4: 'Region E', 5: 'Region F'}, 'cases': {0: 139, 1: 20, 2: 432, 3: 511, 4: 21, 5: 11}, 'population': {0: 123000, 1: 56329, 2: 70459, 3: 234299, 4: 1478, 5: 2566}}
    dataset = pd.DataFrame(datadict)
    print(dataset)
    #Add a column calculating cases per 10 000
    #Add a column with values of cases per 10 000 citizens

    #Add a row with aggregated values from all regions

    #calculate and display mean values for each numerical column (cases, population, cases per 10 000 population)

    #print the table

    // Javascript

    dataobject = {"region":{"0":"Region A","1":"Region B","2":"Region C","3":"Region D","4":"Region E","5":"Region F"},"cases":{"0":139,"1":20,"2":432,"3":511,"4":21,"5":11},"population":{"0":123000,"1":56329,"2":70459,"3":234299,"4":1478,"5":2566}}
  3. mixmixmix revised this gist May 20, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions data example
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,8 @@ print(dataset)

    #calculate and display mean values for each numerical column (cases, population, cases per 10 000 population)

    #print the table

    // Javascript

    dataobject = {"region":{"0":"Region A","1":"Region B","2":"Region C","3":"Region D","4":"Region E","5":"Region F"},"cases":{"0":139,"1":20,"2":432,"3":511,"4":21,"5":11},"population":{"0":123000,"1":56329,"2":70459,"3":234299,"4":1478,"5":2566}}
  4. mixmixmix revised this gist May 20, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions data example
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,6 @@ print(dataset)

    #calculate and display mean values for each numerical column (cases, population, cases per 10 000 population)

    // Javascript

    dataobject = {"region":{"0":"Region A","1":"Region B","2":"Region C","3":"Region D","4":"Region E","5":"Region F"},"cases":{"0":139,"1":20,"2":432,"3":511,"4":21,"5":11},"population":{"0":123000,"1":56329,"2":70459,"3":234299,"4":1478,"5":2566}}
  5. mixmixmix created this gist May 20, 2020.
    11 changes: 11 additions & 0 deletions data example
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    import pandas as pd
    datadict = {'region': {0: 'Region A', 1: 'Region B', 2: 'Region C', 3: 'Region D', 4: 'Region E', 5: 'Region F'}, 'cases': {0: 139, 1: 20, 2: 432, 3: 511, 4: 21, 5: 11}, 'population': {0: 123000, 1: 56329, 2: 70459, 3: 234299, 4: 1478, 5: 2566}}
    dataset = pd.DataFrame(datadict)
    print(dataset)
    #Add a column calculating cases per 10 000

    #Add a row with aggregated values from all regions

    #calculate and display mean values for each numerical column (cases, population, cases per 10 000 population)