我无法将csv转换为json格式 这是我一直在尝试的代码:
import boto3
import csv
import json
s3 = boto3.resource('s3')
s3_client = boto3.client('s3')
my_bucket = s3.Bucket('bucket_name')
def lambda_handler(event, context):
result = s3_client.get_object(Bucket=my_bucket, Key='Untitled1.csv')
text = result["Body"].read().decode("utf-8")
output = json.dumps([[ row for row in text ]])
print(output)
return text