This file contains 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
Democratic Backsliding in the World’s Largest Democracy | |
Sabyasachi Das* | |
Ashoka University | |
July 3, 2023 | |
Abstract | |
Democratic backsliding is a growing concern globally. This paper contributes to the discussion | |
by documenting irregular patterns in 2019 general election in India and identifying whether they are | |
due to electoral manipulation or precise control, i.e., incumbent party’s ability to precisely predict | |
and affect win margins through campaigning. I compile several new datasets and present evidence | |
that is consistent with electoral manipulation in closely contested constituencies and is less supportive of the precise control hypothesis. Manipulation appears to take the form of targeted electoral |
This file contains 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
def bootstrap_ci(data, func, true_col, pred_col, duration_col=None, n_bootstrap=200, alpha=0.05): | |
""" | |
Calculate the confidence interval using bootstrapping. | |
Parameters | |
---------- | |
data: DataFrame | |
The data | |
func: callable |
This file contains 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
import gzip | |
import numpy as np | |
import concurrent.futures | |
from sklearn.datasets import fetch_20newsgroups | |
# dataset | |
newsgroups_train = fetch_20newsgroups(subset='train') | |
newsgroups_test = fetch_20newsgroups(subset='test') |
This file contains 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
""" | |
This script renames the daily files from roam research | |
to an specified format - 1900-12-25-Sunday.md | |
Change the default_date_fmt to your required Daily Note Format | |
Usage: | |
-------- | |
pip install typer[all] |
This file contains 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
""" | |
Author: Rohan Singh (singhrohan@outlook.com) | |
Use this code to send yourself a message when a relevant one appears in the `group_name` | |
Also, get notifications on mac | |
Usage | |
=========== | |
Go to: https://my.telegram.org to create an app |
This file contains 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
a = ['[\\n\\t', 'print(f"a = [{a}]")', 'for i in range(1, len(a)):', "\tprint(f'{a[i]}')\n\t"] | |
print(f"a = [{a}]") | |
for i in range(1, len(a)): | |
print(f'{a[i]}') |
This file contains 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
keyword,count | |
roamresearch,12 | |
notionhq,6 | |
heyhey,5 | |
ouraring,3 | |
readwiseio,3 | |
copilotmoney,3 | |
mmhmmapp,3 | |
chalkapp,3 | |
gmail,3 |
This file contains 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
import logging | |
import os | |
LOG_FORMAT = '%(asctime)s %(name)s %(levelname)s %(funcName)s %(lineno)s ClaimID: %(claim_id)s: %(message)s' | |
class AppLogger(logging.Logger): | |
# Override all levels similarly - only info overriden here |
This file contains 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
{ | |
"Just Capital": "https://justcapital.com/reports/the-covid-19-corporate-response-tracker-how-americas-largest-employers-are-treating-stakeholders-amid-the-coronavirus-crisis/", | |
"The Korean Clusters": "https://graphics.reuters.com/CHINA-HEALTH-SOUTHKOREA-CLUSTERS/0100B5G33SB/index.html", | |
"World Central Kitchen": "http://wck.org/", | |
"Spillover": "https://wwnorton.com/books/spillover/", | |
"Podcast about Spillover": "https://www.scientificamerican.com/podcast/episode/david-quammen-the-spillover-of-anim-12-11-18/", | |
"From Bats to Human Lungs, the Evolution of a Coronavirus": "https://www.newyorker.com/science/elements/from-bats-to-human-lungs-the-evolution-of-a-coronavirus", | |
"DonorsChoose.org": "http://donorschoose.org/", | |
"Li Ziqi": "https://www.sixthtone.com/news/1005007/how-li-ziqi-repackages-rural-china-for-urban-fantasies", | |
"Bon Appetit YouTube Channel": "https://www.youtube.com/user/BonAppetitDotCom", |
This file contains 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
import re | |
import pandas as pd | |
from collections import defaultdict | |
def parse_text(data_blocks): | |
""" | |
Generate a dict which could be converted easily to a pandas dataframe | |
:param data_blocks: splittable data | |
:return: dict with row values for every column |
NewerOlder