Hello Le Wagon 👋
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://stackoverflow.com/questions/51122413/regex-for-extracting-all-complex-dates-formats-from-a-string-in-python | |
| import re | |
| import calendar | |
| class DateRegex: | |
| def __init__(self): | |
| # create regex helper strings | |
| full_months = [month for month in calendar.month_name if month] | |
| short_months = [d[:3] for d in full_months] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Make first letter of each word capital and the rest lower case | |
| # loop through each row in your column | |
| for (i in 1:nrow(dataframe)) { | |
| #split the string into words and save as a vector | |
| c <- unlist(str_split(dataframe$column[i], " ")) | |
| #loop through the vector you just created | |
| for (j in 1:length(c)) { |