以下是我目前为止尝试过的代码
import json
import csv
with open('/dbfs/mnt/costtransparency/HealthPlans/UHC/2022-11/2022-11-01_United-HealthCare-Services--Inc-_Third-Party-Administrator_Winstead_CSP-903-C746_in-network-rates.json.gz') as f:
d=json.load(f)
employee_data = d['in_network']#d['provider_references']
# now we will open a file for writing
data_file = open('/dbfs/FileStore/data_file.csv', 'w')
# create the csv writer object
csv_writer = csv.writer(data_file)
# Counter variable used for writing
# headers to the CSV file
count = 0
for emp in employee_data:
if count == 0:
# Writing headers of CSV file
header = emp.keys()
csv_writer.writerow(header)
count += 1
# Writing data of CSV file
csv_writer.writerow(emp.values())
data_file.close()
这里的问题是,目前我存储csv文件到存储,但我想把它存储到增量表。
有人能帮我做这个吗
1条答案
按热度按时间e0bqpujr1#
如何在增量表中追加数据?
如果要将数据追加到增量表中,请使用以下代码:
或者