[SciPy-user] TimeSeries concatenate

Robert Ferrell ferrell@diablotech....
Fri May 22 22:59:48 CDT 2009


Thanks for the gentle reminder about help().  Sometimes I remember -  
hopefully more often now.  That does indeed have exactly the  
information I was looking for.

-robert

On May 22, 2009, at 2:16 PM, Matt Knox wrote:

>> Question: What happens to duplicate dates?  It seems that the data in
>> the first series is used.  Is that the rule?
>
> One thing I would recommend (which is not obvious to new python  
> users many
> times) is to check the function doc strings using the built in  
> "help" function
> (see below). So to answer your question, yes that is the rule IF the
> `remove_duplicates` parameter is set to "True" (which is the default).
>
> - Matt
>
>>>> import scikits.timeseries as ts
>>>> help(ts.concatenate)
> Help on function concatenate in module scikits.timeseries.tseries:
>
> concatenate(series, axis=0, remove_duplicates=True,  
> fill_missing=False)
>    Joins series together.
>
>    The series are joined in chronological order.
>    Duplicated dates are handled with the `remove_duplicates`  
> parameter.
>    If `remove_duplicate` is False, duplicated dates are saved.
>    Otherwise, only the first occurence of the date is conserved.
>
>
>    Parameters
>    ----------
>    series : {sequence}
>        Sequence of time series to join
>    axis : {0, None, int}, optional
>        Axis along which to join
>    remove_duplicates : {False, True}, optional
>        Whether to remove duplicated dates.
>    fill_missing : {False, True}, optional
>        Whether to fill the missing dates with missing values.
>
>    Examples
>    --------
>>>> a = time_series([1,2,3], start_date=now('D'))
>>>> b = time_series([10,20,30], start_date=now('D')+1)
>>>> c = concatenate((a,b))
>>>> c._series
>    masked_array(data = [ 1  2  3 30],
>          mask = False,
>          fill_value=999999)
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user



More information about the SciPy-user mailing list