Glider
Loading...
Searching...
No Matches
JooxTemplate.py
Go to the documentation of this file.
1import re
2
4 def date(self, filename):
5 """Sets date column given the filename (it contains the date)
6 For example gyrostream-pty-ltd_joox_202306_Monthly-Sales.csv
7 Args:
8 filename (str): current filename
9 Returns: date_str (str)
10 """
11 date = re.findall(r'_20\d{4}_', filename)[0]
12 date = date.replace("_", "")
13 date_str = date[:4]+"-"+date[4:]+"-01"
14 # df["date_from_file"] = date_str
15 return date_str