Analyze Polis data with your own Python scripts

2023-06-21 We collected data by Polis in EC2 on our own.

py

import pandas as pd
df = pd.read_csv("/Users/nishio/Downloads/polis.csv")
matrix = df.pivot_table(index="pid", columns="tid", values="vote")
print(matrix)

image 75 rows

https://github.com/compdemocracy/analysis/blob/master/notebooks/jupyter/american-assembly-representative-groups-and-comments.ipynb

py

matrix = matrix.dropna(thresh=3)
print(matrix.shape)
# => (59, 8)

The paper said 7 was the threshold, but it actually looks like 3.

K-3 image

Polis: Scaling Deliberation by Mapping High Dimensional Opinion Spaces

image

image

image

imageimage 0 12 1 36 2 11 Hmmm, I got a picture that looks like that, but the results don’t match.

2023-06-22CodeReading

It’s done.

  • image :
comment 7
Count of +1 votes in group:  0.0
Count of 0 votes in group:  2.0
Count of -1 votes in group:  12.0
 
Count of +1 votes outside group:  19.0
Count of 0 votes outside group:  19.0
Count of -1 votes outside group:  7.0
 
pvalue:  5.840739168435112e-05

Polis clustering and calculation of “characteristic responses” per cluster from CSV of polling data without Polis backend implementation.

2023-06-22 imageimage

image

Related next Polis2024-05-13.


This page is auto-translated from /nishio/Polisのデータを解析 using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I’m very happy to spread my thought to non-Japanese readers.