Loading...
Searching...
No Matches
Go to the documentation of this file.
4 def date(self, filename):
5 """Sets date column given the filename (it contains the date)
6 For example Nightlife_2022_Q4.csv
8 filename (str): current filename
9 Returns: date_str (str)
12 quarter = {
"Q1":
"01",
"Q2":
"04",
"Q3":
"07",
"Q4":
"10"}
13 year = re.findall(
r'_20\d{2}', filename)[0]
14 year = year.replace(
"_",
"")
15 q = re.findall(
r'_Q\d{1}', filename)[0]
16 q = q.replace(
"_",
"")
18 date_str = year+
"-"+month+
"-01"