Search code examples
pythonsklearn-pandas

How to display date in new table


I apologize for the weird title, I'm new and I don't quite know the term for my question. I made a stock prediction program following a tutorial and this is what it displays right now. How do I get the dates to display alongside their respective prices? In the .csv file, the column showing dates is labeled 'Date'.

enter image description here

This is the code that creates this table

dframe = pd.DataFrame({'Actual':y_test.flatten(), 'Predicted': predicted.flatten()})

Solution

  • If I don't misunderstand your question you just want to add a new column to your data frame. Just add a new column to your dframe from your csv data.

    dframe["newcolumnfordate"]=data["Date"]