Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.
You are given two .csv les that contain slightly different tables. You will have to create a new table with certain conditions: 80 from these two...
Requirements for the combined table:
- You can't modify and save data manually. I will provide a different set of tables as a test.
- The combined table keeps the same Tweets from the original tables
- Date is represented using datetime object. Do not create these strings as it will involve a lot of concatenations.
- The combined table is sorted by the "Date" column
- The combined table is saved as combined.csv and contains only two columns.
Important Notes:
- This is going to be a script, not a function.
- It must work for these specific file names and table formats.
- That means that table 1 will always have a tweet, month, day, year and table 2 will have day, month, year, hour, and tweet.
- Remove the index with index=False
- Make sure that the DATE is sorted, not the string that makes up the date.
- Be careful with uppercase Y vs lowercase y when parsing the year.
- If you write any helper methods, make sure to have a valid docstring and doctests.
- If you do not save to "combined.csv", you will fail this problem completely.
- Make super sure that your pathing is relative. If it isn't, you will fail this problem completely.
Helpful resources and hints:
- Knowing how to read from/to .csv file is a key
- For datetime representation: http://strftime.org/
- Create date object: use example from the lecture
- Sort by "Date". I found these two links helpful. Combine the information from them:
- https://stackoverflow.com/questions/44123874/dataframe-object-has-no-attribute-sort
- https://stackoverflow.com/questions/28161356/sort-pandas-dataframe-by-date
- You might want to think about append at one point
- You will need at least one function that will be used with apply.