I get tables as the attached images. It says class 'pandas.core.frame.DataFrame' when I checked its type. I get the tables by running for loop. I would like to keep merging/joining the tables by using index as below. Thank you for your help in advance! I attached my codes just in case.
# Loop credentials
for credential in config.api_credentials:
# Parameters
security_key = ''
system_id = credential[0]
name = credential[1]
api_id = credential[2]
api_pass = credential[3]
solar_id = credential[4]
solar_tables = {}
auth_url = "https://example.com/customer/authenticate?login=" + \
api_id + "&password=" + api_pass + "&json=1"
res = requests.post(auth_url)
data = res.json()
if data.get('securitykey') == None:
print("There is no securitykey")
else:
security_key = data.get('securitykey')
get_historical_data_url = "https://example.com/location/getHistoricalData?security_key=" + \
security_key + "&json=1&startTime=2013-02-14T23:59&period=months"
res2 = requests.get(get_historical_data_url)
res2_text = res2.text
production_data = json.loads(res2_text)
production_data2 = production_data.get(system_id).get('data')
# Transpose columns and rows
production_data3 = pd.DataFrame(production_data2).transpose()
# Drop useless columns and only keep solar production data
solar_data = production_data3.loc[:, [solar_id]]
# Extract and replace production values to absolute values
solar_data[solar_id] = solar_data[solar_id].str.get(
'kWh').astype(float).abs()
# Change Label to system id + name
solar_data.rename(columns={solar_id: system_id+"_"+name}, inplace=True)
# Change index from datetime to date only
solar_data.index = solar_data.index.str.split().str[0]
print(type(solar_data))
print(solar_data)