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


Python DataFrameClient.delete_series方法代码示例

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


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

示例1: DataFrameClient

# 需要导入模块: from influxdb.influxdb08 import DataFrameClient [as 别名]
# 或者: from influxdb.influxdb08.DataFrameClient import delete_series [as 别名]
processed_list = [
                  [ 'wage_lag_15m', 'mlag(wage_us_yoy,15)' ],
                  [ 'zillow_median_sale_price_15m', 'mlag(zillow_median_sale_price_yoy,15)' ],
                  ]

df = DataFrameClient('localhost',8086,'root','root')
if({'name':'Econ'} not in df.get_list_database()):
    df.create_database('Econ')
df.switch_database('Econ')

#add all items in interested list
start = timeit.default_timer()
for item in interest_list:
    if item[0] in df.get_list_series():
        df.delete_series(item[0])
    results = influx_Fred.interpret(item[1])
    results = results.replace(to_replace='NaN',value='.')
    results = DataFrame({'value':results['value']})
    df.write_points({item[0]:results})
    print item
print 'total time in seconds: %.2f' % (timeit.default_timer() - start)

#add all items in processed list
start = timeit.default_timer()
influx_Econ = InfluxDB(db_name='Econ')
for item in processed_list:
    if item[0] in df.get_list_series():
        df.delete_series(item[0])
    results = influx_Econ.interpret(item[1])
    results = results.replace(to_replace='NaN',value='.')
开发者ID:haomen,项目名称:PlayData,代码行数:32,代码来源:USData.py

示例2: QuandlAPI

# 需要导入模块: from influxdb.influxdb08 import DataFrameClient [as 别名]
# 或者: from influxdb.influxdb08.DataFrameClient import delete_series [as 别名]
'''
Created on Jul 8, 2015

@author: shaunz
'''

from QuandlAPI import QuandlAPI
from influxdb.influxdb08 import DataFrameClient
from QuandlTicker import Quandl_ticker_list
import timeit

quandl = QuandlAPI()
df = DataFrameClient('localhost', 8086, 'root', 'root')
if({'name':'Quandl'} not in df.get_list_database()):
    df.create_database('Quandl')

df.switch_database('Quandl')

for series in df.get_list_series():
    df.delete_series(series)

start = timeit.default_timer()
for item in Quandl_ticker_list:
    results = quandl.get_series(item[1],item[2],item[3])
    results = results.replace(to_replace='NaN',value='.')
    print item
    df.write_points({item[0]:results})
print 'total time in seconds: %.2f' % (timeit.default_timer() - start)
开发者ID:EliteTRADER,项目名称:FredDB,代码行数:30,代码来源:QuandlAPITest.py


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