klar-EDA
klar-EDA copied to clipboard
Implement a method for date feature extraction in csv data preprocessor
Description
a. Write a method to identify the columns of type
date(this may include iterating over the list of columns and using an appropriate strategy to identify if a column has values of typedate)
b. Implement another method that should be able to convert the date column into a specific static format (for example - YYYY-MM-DD) and split the date column into separate columns with the following attribute values:
- Date of the month (for example - 28 for '2021-12-28')
- Month (Numerical)
- Year
- Day of the week
c. Appropriate test methods should be implemented in the
date_format_testsfile
Assumptions
The following assumptions can be made during the implementation
- No time is present in the given input date.
- The data frame must contain column names
- A list of input patterns can be assumed. (For example - you can assume the input will be in either of any known formats mentioned).
input_date_format = [ 'DD/MM/YYYY', 'YYYY/DD/MM', 'MM/DD/YYYY', 'YYYY/MM/DD', 'DD-MM-YYYY', 'YYYY-DD-MM', 'MM-DD-YYYY', 'YYYY-MM-DD' ]
Input (Method -1)
None
Output (Method-1)
list of column names with values of type date
Method details
Use the data frame from the
self.dfvariable.
Input (Method -2)
An expected format the input date should be converted to
Output (Method-2)
None
Method details
Use the data frame from the
self.dfvariable.
Implement a method for the same with appropriate name and parameters in the
csv_preprocess.pyfile.
In the implementation use the method
convert_date_formatfor converting the date into a specific format & the method-1 mentioned above to get a list of columns with date type.
Note
The use of standard python libraries is highly recommended.
JOIN THE SLACK CHANNEL HERE if you wish to contribute to this issue.
I would like to work on this issue
I want to work on this issue. Is it still available to work on?
@mehak6569, please find the first steps in the slack channel
@mehak6569, please find the first steps in the slack channel
Ok, Thank you!
I want to work on this issue. Please assign this to me. I joined to Slack channel.