View the step-by-step solution to:

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...

python3 question屏幕快照 2018-05-16 下午2.05.43.png

Requirements for the combined table:

  1. You can't modify and save data manually. I will provide a different set of tables as a test.
  2. The combined table keeps the same Tweets from the original tables
  3. Date is represented using datetime object. Do not create these strings as it will involve a lot of concatenations. 
  4. The combined table is sorted by the "Date" column
  5. The combined table is saved as combined.csv and contains only two columns.


Important Notes:

  1. This is going to be a script, not a function.
  2. 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.
  1. Remove the index with index=False
  2. Make sure that the DATE is sorted, not the string that makes up the date.
  3. Be careful with uppercase Y vs lowercase y when parsing the year.
屏幕快照 2018-05-16 下午2.05.43.png

You are given two .csv files that contain slightly different tables. You will have to create a new table with certain conditions: 80 from these two given tables: Tweet Hour Tweet
Hello World _ 12 Happy New Year lwant ice-cream! _ _ 7 Today is my final
Friends will be friends _ _ 23 Summer is about to begin Done with school I . 11 Ocean is still cold you should get a new table that looks like this: combined.csv
Date Tweet 15-Jul-18 Ocean is still cold
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

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question