My source is txt file which takes the form of:
cpu95-20000117-04004,134.perl,42.6,44.4
cpu95-20000117-04004,147.vortex,44.7,44.7
I would like to parse the date with python into a form that can be plotted with matplotlib.pyplot
(i.e. no strings or Timestamp objects).
I will plot the last item (i.e. 44.4) against the dates (i.e. 2000/01/17).
I'm also using this data as an input for scikitlearn linear regression model
later on so I believe it should be int
or float
. Thanks much.
PS - I checked similar questions, but the trend is to use either .date()
method or panda's pd.to_datetime
and its variations, or methods that produce sorts of objects that don't fit into scikit model
or matplotlib
.
EDIT
I should be more clear: I would like to plot the real dates
(so no toordinal
), and therefore cannot use the datetime option (wouldn't work for pyplot
and scikit
, when trying to turn datetime
to int
); therefore, I probably need to find a way to treat something like 2000/01/17 or 2000.01.17 as an integer.