Regular Expression in Python with Examples | Set 1 Module Regular Expressions(RE) specifies a set of strings(pattern) that matches it. To understand the RE analogy, MetaCharacters are useful, important and will be used in functions of module re. There are a total of 14 metacharacters and will be discussed as they follow into functions: \ Used to drop the special meaning of character following it (discussed below) [] Represent a character class ^ Matches the beginning $ Matches the end . Matches any character except newline ? Matches zero or one occurrence. | Means OR (Matches with any of the characters separated by it. * Any number of occurrences (including 0 occurrences) + One or more occurrences {} Indicate number of occurrences of a preceding RE to match. () Enclose a group of REs Function compile() Regular expressions are compiled into pattern objects, which have methods for various operations such as searching for pattern matches or performin
Posts
Permutation and Combination
- Get link
- X
- Other Apps
Permutations and Combinations are super useful in so many applications – from Computer Programming to Probability Theory to Genetics. I'm going to introduce you to these two concepts side-by-side, so you can see how useful they are. The key difference between these two concepts is ordering. With Permutations , you focus on lists of elements where their order matters. For example, I was born in 1977 . That's number 1 followed by number 9 , followed by number 7 , followed by number 7 . In that particular order. If I change the order to 7917 instead, that would be a completely different year. Thus, the order matters . With Combinations on the other hand, the focus is on groups of elements where the order does not matter. Like my cup of coffee is a combination of coffee , sugar and water . It doesn't matter which order I add these ingredients are in. There may as well be water , sugar and coffee , it's still the same cup of coffee. Th
How to Build a Bar Chart Race on COVID-19
- Get link
- X
- Other Apps
Using the new Tableau version 2020.1 onwards To build a bar chart race is to create many discrete pages of bar charts and then string them together, just like how a traditional cartoon animation is built. In Dec 2019, Tableau released 2020.1 beta version with a new Animations feature for dynamic parameters. This means that the bar chart race below is now very easy to build. Pre-requisites Download and install Tableau Public (latest version 2020.1.2 onwards). It is free of charge with full functionality. The only snag is that any work done can only be published on the Tableau Public server, and not saved locally to your Desktop. This is alright if the data is not sensitive or private. Download the latest COVID-19 data (in *.xlsx format) from the European Centre for Disease Prevention and Control website , and rename it using a generic filename “COVID-19-geographic-distribution-worldwide.xlsx”. You can replace this file with the updated data later, using the same filen