1

I have been chipping away at a side project for a while, and am coming up against a wall (most likely made by my own mistakes). I am attempting to create a csv repository of words used in news articles and their frequency, when written as titles of the news stories and on which day they are used with this format:

Chart basic format, with words as columns and their frequencies charted by the date

I am attempting to have it work in this shape, with words as the recorded columns and the dates as the row/index with the frequency being recorded in a table. I have been attempting to do this with Python's Pandas library, but have had minimal success in updating a csv or a Dataframe with new information. It has either overwritten the csv with new information and ignored the date index, or has not adjoined them as I expected from information from here. I've also added screenshots of my code page1 page2 page3.

If there anyone has any advice on how to proceed, or if there is a better way to record this information, I would greatly appreciate the help. Thank you all in advance.

-Brad

  • 1
    I had a look at the code. I don't think you will get the help you want unless you can provide a specific example of how you are trying to update the dataframe, the expected results. and the actual results. Also don't post screenshots of code, It prevents people from being able to verify your example. – James Schinner Jan 22 '18 at 00:25
  • Hey Brad welcome to StackOverflow... Good advice from @JamesSchinner. Check out [this SO page](https://stackoverflow.com/help/how-to-ask) to see the steps to asking a good question. – Alex Jan 22 '18 at 00:31
  • You can check out pandas.DataFrame.append, https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.append.html. You can also append to a CSV file: https://stackoverflow.com/questions/17530542/how-to-add-pandas-data-to-an-existing-csv-file – Evan Jan 22 '18 at 02:11

0 Answers0