How to convert Pandas Series of dates string into date objects?

Essentially equivalent to @waitingkuo, but I would use pd.to_datetime here (it seems a little cleaner, and offers some additional functionality e.g. dayfirst): In [11]: df Out[11]: a time 0 1 2013-01-01 1 2 2013-01-02 2 3 2013-01-03 In [12]: pd.to_datetime(df[‘time’]) Out[12]: 0 2013-01-01 00:00:00 1 2013-01-02 00:00:00 2 2013-01-03 00:00:00 Name: time, dtype: datetime64[ns] In … Read more

Is it possible to do multivariate multi-step forecasting using FB Prophet?

You can add additional variables in Prophet using the add_regressor method. For example if we want to predict variable y using also the values of the additional variables add1 and add2. Let’s first create a sample df: import pandas as pd df = pd.DataFrame(pd.date_range(start=”2019-09-01″, end=”2019-09-30″, freq=’D’, name=”ds”)) df[“y”] = range(1,31) df[“add1”] = range(101,131) df[“add2”] = … Read more

Counting frequency of values by date using pandas

It might be easiest to turn your Series into a DataFrame and use Pandas’ groupby functionality (if you already have a DataFrame then skip straight to adding another column below). If your Series is called s, then turn it into a DataFrame like so: >>> df = pd.DataFrame({‘Timestamp’: s.index, ‘Category’: s.values}) >>> df Category Timestamp … Read more

Using JFreeChart to display recent changes in a time series

The JFreeChart class DynamicTimeSeriesCollection is a good choice. Addendum: As noted by @Bahadır, the last point of the series was persistently zero. @Don helpfully suggests advancing the time and then appending the data. dataset.advanceTime(); dataset.appendData(newData); import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Random; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JPanel; import javax.swing.Timer; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)