Problem with params in python

Can anyone tell why this code does not work? This time around I get the following error:

image

Get PurpleAir sensor data from PurpleAir API into dataframe

James S. Lucas 20210319

import pandas as pd
import requests
pd.set_option(‘display.max_rows’, None)
pd.set_option(‘display.max_columns’, None)
pd.set_option(‘display.width’, None)
pd.set_option(‘display.max_colwidth’, None)

def get_sensor_data(PA_READ_KEY):
root_url = “https://api.purpleair.com/v1/sensors/
params = {
‘nwlng’ = ‘-128.846112’,
‘nwlat’ = ‘55.70631’,
‘selng’ = ‘-125.43329’,
‘selat’ = ‘54.09766’
}
url_template = root_url
url = url_template.format(**params)
header = {“X-API-Key”:PA_READ_KEY}
response = requests.get(url, headers=header)
if response.status_code == 200:
#print(response.text)
df = pd.read_json(response.text)
else:
raise requests.exceptions.RequestException
return df

PA_READ_KEY = ‘321247F5-3E4D-11EB-9893-42010A8001E8’

df = get_sensor_data(PA_READ_KEY)

try : instead of = in params object. like below

params = {
‘nwlng’ : ‘-128.846112’,
‘nwlat’ : ‘55.70631’,
‘selng’ : ‘-125.43329’,
‘selat’ : ‘54.09766’
}