Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

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:

  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.
  4. If you write any helper methods, make sure to have a valid docstring and doctests.
  5. If you do not save to "combined.csv", you will fail this problem completely.
  6. 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. 
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question