I have a dataframe that looks like this:
date number_of_books ... (additional columns)
1997/06/01 23:15 3
1999/02/19 14:56 5
1999/10/22 18:20 7
2001/11/04 19:13 19
... ...
2014/04/30 02:14 134
My goal is to create an empty scatter plot and then add each point separately since the color of the point depends on other factors within the dataframe. However, I am having trouble finding a way to create an empty scatter plot without using my dataframe yet. Is there a way to do that? (possibly by making a variable hold the plot?) I want the x-axis to be the just the date (YYYY/MM/DD) and the y axis the number of books.
My plan is to convert the date string and number_of_book strings right before I add them to the plot. So the idea would be...
for index, row in df.itterows()
convert date to datetime and number_of_books to int
if condition met (based on other columns):
plot with color blue
else:
plot with color red