File size: 631 Bytes
b11ac48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pandas as pd


def main():
    corpus_df = pd.read_excel("data/migration/corpus_titoli_2013_2021_with_most_recent_years.xlsx")
    ratings = corpus_df.groupby("Testata").first()[["Orientamento politico", "Religiosa?"]]
    ratings.index.rename("provider", inplace=True)
    ratings["political_stance"] = ratings["Orientamento politico"]
    ratings["religious"] = ratings["Religiosa?"] == "religiosa"
    ratings.drop("Orientamento politico", axis=1, inplace=True)
    ratings.drop("Religiosa?", axis=1, inplace=True)

    ratings.to_csv("data/migration/provider_pol_rel_ratings.csv")


if __name__ == "__main__":
    main()