Question
Python3 Pandas Requirements for the combined table: You can't modify and save data manually. The combined table keeps the same Tweets from the original tables
Python3 Pandas
Requirements for the combined table:
You can't modify and save data manually.
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 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.
Make super sure that your pathing is relative. If it isn't, you will fail this problem completely.
hints:
Knowing how to read from/to .csv file
For datetime representation: http://strftime.org/
Create date object
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. Should take ~22 lines or more less
You are given two.csv files that contain slightly different tables. You will have to create a new table with certain conditions So from these two given tables data1.csv data2.csv Tweet Hello World I want ice-cream! Friends will be friends Done with school Month Day Year Month Day Year Hour Tweet 2013 January 2013 March 2017 May 2017 July 2 21 30 15 2015 2016 2017 2018 6 12 Happy New Year 2 23 30 12 7 Today is my final 23 Summer is about to begin 11 Ocean is still cold 12 you should get a new table that looks like this combined.csv Tweet Date 15-Jul-18 Ocean is still colod 12-Dec-17 Done with school 30-Sep-17 Friends will be friends 30-May-17 Summer is about to begin 21-Mar-16 Today is my final 02-Jan-15 Happy New Year 23-Jul-13 I want ice-cream! 02-Jun-13 Hello World
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started