Posts

Showing posts with the label week24

2020: Week 24

Image
There has been many a battle fought on British soil across the years and this website provides a lot of information about many of the battlefields. It's a great website to practice our webscraping skills, but webscraping doesn't always lead to the cleanest of datasets. So this week's focus will be on cleaning up a subset of our webscraped data. Input Requirements Input the data. Find a natural way to split the data into different fields. Remove rows which are incomplete. i.e. if they do not have information in each field. Clean battle names. Ensure each row has a unique battle name. Clean the dates. For those dates with a date range, just use the start date. The dateparse function may be useful here. Clean the Victors, War and Description fields. Output the data. Output 5 fields Date Battle War Victors Description 63 rows (64 including headers) The full output can be  found here  for comparison. Make sure to fill in the...

2019: Week 24 Solution

Image
You can view our full solution workflow below and download it here ! Our full workflow solution. This week saw our first official foray into the world of RegEx. There’s a lot to learn when it comes to RegEx and some great resources to help are https://regexr.com/ & https://regex101.com/. In this solution post I’ll highlight the functions and RegEx we personally used as well as the overarching method for our solution. I'll break down the RegEx within the first calculation, however for the others and for a better understanding I'd recommend using one of the aforementioned resources which help break them down - I find Regex101 is particularly good for this. Use REGEXP_EXTRACT() to find and pull out information REGEXP_EXTRACT() is a function that allows you to look within a string and extract the first instance of a specific combination of characters. It takes two parameters: The string/string field. The RegEx that defines the character string you’re looking for....