当前位置: 首页>>代码示例>>Python>>正文


Python TimeSeriesCalcs.convert_month_day_to_date_time方法代码示例

本文整理汇总了Python中pythalesians.timeseries.calcs.timeseriescalcs.TimeSeriesCalcs.convert_month_day_to_date_time方法的典型用法代码示例。如果您正苦于以下问题:Python TimeSeriesCalcs.convert_month_day_to_date_time方法的具体用法?Python TimeSeriesCalcs.convert_month_day_to_date_time怎么用?Python TimeSeriesCalcs.convert_month_day_to_date_time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pythalesians.timeseries.calcs.timeseriescalcs.TimeSeriesCalcs的用法示例。


在下文中一共展示了TimeSeriesCalcs.convert_month_day_to_date_time方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TimeSeriesRequest

# 需要导入模块: from pythalesians.timeseries.calcs.timeseriescalcs import TimeSeriesCalcs [as 别名]
# 或者: from pythalesians.timeseries.calcs.timeseriescalcs.TimeSeriesCalcs import convert_month_day_to_date_time [as 别名]
###### calculate seasonal moves in EUR/USD and GBP/USD (using Quandl data)
if True:
    time_series_request = TimeSeriesRequest(
                start_date = "01 Jan 1970",                     # start date
                finish_date = datetime.date.today(),            # finish date
                freq = 'daily',                                 # daily data
                data_source = 'quandl',                         # use Quandl as data source
                tickers = ['EURUSD',                            # ticker (Thalesians)
                           'GBPUSD'],
                fields = ['close'],                                 # which fields to download
                vendor_tickers = ['FRED/DEXUSEU', 'FRED/DEXUSUK'],  # ticker (Quandl)
                vendor_fields = ['close'],                          # which Bloomberg fields to download
                cache_algo = 'internet_load_return')                # how to return data

    ltsf = LightTimeSeriesFactory()

    df = ltsf.harvest_time_series(time_series_request)

    df_ret = tsc.calculate_returns(df)

    day_of_month_seasonality = seasonality.bus_day_of_month_seasonality(df_ret, partition_by_month = False)
    day_of_month_seasonality = tsc.convert_month_day_to_date_time(day_of_month_seasonality)

    gp = GraphProperties()
    gp.date_formatter = '%b'
    gp.title = 'FX spot moves by time of year'
    gp.scale_factor = 3
    gp.file_output = "output_data/20150724 FX spot seas.png"

    pf.plot_line_graph(day_of_month_seasonality, adapter='pythalesians', gp = gp)
开发者ID:humdings,项目名称:pythalesians,代码行数:32,代码来源:seasonality_examples.py


注:本文中的pythalesians.timeseries.calcs.timeseriescalcs.TimeSeriesCalcs.convert_month_day_to_date_time方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。