Skip to content

Commit

Permalink
Cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bvlampe committed Oct 22, 2022
1 parent 9fe0c1c commit 040bf54
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def avg_years(values):


def main():
# Read datasets

# Read datasets
homicides = pd.read_csv(loc_homicides)
homicides.drop(columns=homicides.columns[0], axis=1, inplace=True)
ged = pd.read_csv(loc_ged)
Expand All @@ -46,10 +46,8 @@ def main():
# Remove presently ongoing conflicts
conflict_new = conflict_new[conflict_new["has_ended"] == 1]

# Fill end date
# Fill end date for all conflict-years, add start and end year as well as duration
conflict_new["ep_end_date"].fillna(method = "bfill", inplace=True)

# conflict_new = conflict_new[conflict_new["ep_end_date"].notna()]
conflict_new["start_year"] = conflict_new["start_date2"].str[:4].astype(int)
conflict_new["end_year"] = conflict_new["ep_end_date"].str[:4].astype(int)
conflict_new["duration"] = conflict_new["end_year"].astype(int) - conflict_new["start_year"].astype(int) + 1
Expand Down

0 comments on commit 040bf54

Please sign in to comment.