我已经从一个网站上提取了结果,结果是在下面的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
您以错误的方式使用参数,下面是函数签名,来自(link)
数据在哪里
所以你应该这样做:
相关问题 更多 >
编程相关推荐