【发布时间】:2020-11-22 16:48:58
【问题描述】:
我已从网站提取结果,结果格式如下,适用于其他 93 个计划。我已经创建了一个数据框来存储这些信息,稍后会将这个数据框导出到 csv 文件。但是,我遇到了错误
Traceback (most recent call last):
File "C:/Study/Web_Crawl/Test_WebC.py", line 104, in <module>
df = pandas.DataFrame('Snapshot Date', 'URL', 'planId', 'postcode', 'tariffType', 'planName', 'retailerName',
TypeError: __init__() takes from 1 to 6 positional arguments but 20 were given
df = pandas.DataFrame('Snapshot Date', 'URL', 'planId', 'postcode', 'tariffType', 'planName', 'retailerName',
'retailerCode', 'state', 'effectiveDate', 'solarFit', 'discount', 'dailySupplyCharge',
'Controlled Load 1', 'Controlled Load 2', 'Single Rate', 'Off-Peak', 'Peak', 'Shoulder')
结果样本
Snapshot date 2020-08-02
URL https://api.energymadeeasy.gov.au/plans/dpids/PWR93173MBE1?postcode=2000
planId PWR93173MBE1
postcode 2000
tariffType SR
planName Powerbank Bis Flat
retailerName Powerclub
retailerCode PWR
state NSW
effectiveDate 2020-07-15
solarFit
discount
dailySupplyCharge 162.9629
Controlled Load 1
Controlled Load 2
Single Rate 17.9203
Off-Peak
Peak
Shoulder
【问题讨论】: