import loading plt.style.use('ggplot') # for matplotlib versions below 1.5: #mpl.rcParams['axes.color_cycle'] = ['#5DBA42', '#42BAB2', '#E24A33', # '#777777', '#348ABD', '#FBC15E', '#E27533'] mpl.rcParams['axes.prop_cycle'] = cycler('color',['#5DBA42', '#42BAB2', '#E24A33', '#777777', '#348ABD', '#FBC15E', '#E27533']) mpl.rcParams['font.size'] = 28 mpl.rcParams['axes.facecolor'] = 'white' files_path = './data/' figures_path = './figures/' #%% load data from files df_requests = loading.load_requests() df_messages = loading.load_messages() #%% create filters for dataframe is_unique = df_requests['same_as'].isnull() is_complete = (df_requests['status']=='asleep') | \ (~(df_requests['resolution']=='')) def compute_response_time(msg_group): first_msg = pd.to_datetime(msg_group.iloc[0]['timestamp']) resolved_list = ['resolved', 'refused', 'successful', 'not_held', 'partially_successful', 'request_redirected', 'user_withdrew_costs', 'user_withdrew']
from pandas import ExcelWriter from fds_api_pandas_functions import * import loading plt.style.use('ggplot') #mpl.rcParams['axes.color_cycle'] = ['#5DBA42', '#42BAB2', '#E24A33', # '#777777', '#348ABD', '#FBC15E', '#E27533'] mpl.rcParams['axes.prop_cycle'] = cycler('color',['#5DBA42', '#42BAB2', '#E24A33', '#777777', '#348ABD', '#FBC15E', '#E27533']) mpl.rcParams['font.size'] = 20 mpl.rcParams['axes.facecolor'] = 'white' #%% load data from files dataframe = loading.load_requests() #%% create filters for dataframe is_unique = dataframe['same_as'].isnull() is_complete = (dataframe['status']=='asleep') | \ (~(dataframe['resolution']=='')) is_highrank = dataframe['juris_rank'] < 3 is_highbody = dataframe['pbody_class'] == 'Oberste Bundesbehörde' whout_potsdam = ~(dataframe['public_body'] == 'Stadtverwaltung Potsdam') is_chancellor = dataframe['public_body'] == 'Bundeskanzleramt' #%% create different dataframes # all completed requests df_uniq = dataframe[is_unique & is_complete] df_nonuniq = dataframe[is_complete]
import numpy as np import pandas as pd from pandas import ExcelWriter from fds_api_pandas_functions_en import * import loading plt.style.use('ggplot') #mpl.rcParams['axes.color_cycle'] = ['#5DBA42', '#42BAB2', '#E24A33', # '#777777', '#348ABD', '#FBC15E', '#E27533'] mpl.rcParams['axes.prop_cycle'] = cycler('color',['#5DBA42', '#42BAB2', '#E24A33', '#777777', '#348ABD', '#FBC15E', '#E27533']) mpl.rcParams['font.size'] = 32 mpl.rcParams['axes.facecolor'] = 'white' #%% load data from files dataframe = loading.load_requests(translate_to_german=False) #%% create filters for dataframe is_unique = dataframe['same_as'].isnull() is_complete = (dataframe['status']=='asleep') | \ (~(dataframe['resolution']=='')) is_highrank = dataframe['juris_rank'] < 3 is_highbody = dataframe['pbody_class'] == 'Oberste Bundesbehörde' whout_potsdam = ~(dataframe['public_body'] == 'Stadtverwaltung Potsdam') is_chancellor = dataframe['public_body'] == 'Bundeskanzleramt' #%% create different dataframes # all completed requests df_uniq = dataframe[is_unique & is_complete] df_nonuniq = dataframe[is_complete]