Over the last few hrs I’ve been finishing the data cleaning of global terrorism dataset off. I’ve imputed what I need and cleaned the dataset sufficiently. The next step is to look for data of the environmental factors, namely:
- Economic Situation
- Brutality of Government forces
- Crime rate and other related stats
After I get this information and clean the data, I should be able to build the predictor.
I had been able to get in a flow state last time, so I had reasonably good quality of work. I had a few issues and a few learnings too.
- I really struggled with using groupby to get analysis; Essentially what I wanted was all terrorist groups arranged, by country, in descending order by kills , i.e most kills first, least kills last, by country. To create this, I had mainly tried to use groupby() in different ways, however my solution ended up using both groupby, and sort, and set index. I learnt that the most obvious solution isn’t always the right one.
- I also learnt the utility of lambda functions - they’re really useful for filtration and other stuff that normal functions won’t suffice for.
- Additionally, I learnt about a technique to make method chaining cleaner, by using () and writing methods inside that, line by line. An example is given in the picture.
Overall, lot of work and significant progress. Cleaned code is available on github.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.