skip to Main Content

Json – How to make a column from Pandas a variable?

So I have this fine code: import pandas as pd import requests from datetime import datetime now = datetime.now() dt_string = now.strftime("%Y-%m-%dT%H:00:00") url = 'https://api.energidataservice.dk/dataset/Elspotprices?filter={%22PriceArea%22:[%22DK1%22]}&limit=50' r = requests.get(url) json = r.json() # HourUTC HourDK SpotPriceDKK SpotPriceEUR df = pd.DataFrame(json['records']) df2…

VIEW QUESTION

Json – Trying to iterate through a list of dictionaries

I have json list. I would like to iterate "PrivateIP" through a list of dirctories and append to the empty list: here's the code: InstanceId = [] message = [{"SNowTicket":"RITM00001","ServerIPList":[{"PrivateIP":"182.0.0.0", "HostName":"ip-182-0-0-0.ec2.internal", "Region":"us-east-1", "AccountID":"12345678"}, {"PrivateIP": "182.1.1.1", "HostName": "ip-182-1-1-1.ec2.internal", "Region": "us-east-1", "AccountID":…

VIEW QUESTION
Back To Top
Search