Loading...
Searching...
No Matches
Go to the documentation of this file.
2from pandas
import read_csv
5 def date(self, filename):
6 """Sets date column given the filename (it contains the date)
7 For example gyrostream-pty-ltd_slacker_202301_Monthly-Sales.txt
9 filename (str): current filename
10 Returns: date_str (str)
12 date = re.findall(
r'_20\d{4}_', filename)[0]
13 date = date.replace(
"_",
"")
14 date_str = date[:4]+
"-"+date[4:]+
"-01"