Q:

Creating pandas series from two given pd.Series

I'm having a pandas issue.
So I have a pd.Series, serie_1, that looks like the following:
timestamp
2010-05-01      2
2010-06-01      1
2010-07-01      2
2010-08-01      3
2010-09-01      0
2010-10-01      5

And I have another pd.Series, serie_2, that looks like the following:
timestamp
2010-02-01     0
2010-03-01     0
2010-04-01     0
2010-05-01     1
2010-06-01     1
2010-07-01     2
2010-08-01     3
2010-09-01     0
2010-10-01     2

Note that serie_2 starts in 2010-02-01, while serie_1 starts in 2010-05-01. I need to create a pd.Series, call it output_serie, from both serie_1 and serie_2, so that  output_serie.index is serie_2.index, and output_serie.values is equal to serie_1.values/serie_2.values.
the output would look like the following:
timestamp
2010-02-01     0
2010-03-01     0
2010-04-01     0
2010-05-01     2
2010-06-01     1
2010-07-01     1
2010-08-01     1
2010-09-01     0
2010-10-01     2

It is not a coincidence that, in both serie_1 and serie_2, 0 valued timestamps are the same (for example, in 2010-09-01).
The only problem is that serie_2 starts in 2010-02-01, and I need to keep those months with the 0 value in the final pd.Series.
Any help on this issue will be highly appreciated.

A:

In [53]: serie_1.divide(serie_2).fillna(0).astype(int)
Out[53]: 
2010-02-01    0
2010-03-01    0
2010-04-01    0
2010-05-01    2
2010-06-01    1
2010-07-01    1
2010-08-01    1
2010-09-01    0
2010-10-01    2
dtype: int64

This is the setup I used:
import pandas as pd

serie_1 = pd.Series([2, 1, 2, 3, 0, 5], index=pd.DatetimeIndex(["2010-05-01", "2010-06-01", "2010-07-01", "2010-08-01", "2010-09-01", "2010-10-01", ]), )

serie_2 = pd.Series([0, 0, 0, 1, 1, 2, 3, 0, 2], index=pd.DatetimeIndex(["2010-02-01", "2010-03-01", "2010-04-01", "2010-05-01", "2010-06-01", "2010-07-01", "2010-08-01", "2010-09-01", "2010-10-01", ]), )

