I have a function that takes in longitude, latitude, and UNIX time format. And outputs a single row dataframe with weather-related columns
['time', 'summary', 'icon', 'precipIntensity', 'precipProbability','precipType', 'temperature', 'apparentTemperature', 'dewPoint','humidity', 'pressure', 'windSpeed', 'windBearing', 'cloudCover','uvIndex', 'visibility']
def get_weather(latitude,longitude,unix):
url = "https://dark-sky.p.rapidapi.com/"+latitude+','+longitude+','+unix
headers = {
'x-rapidapi-key': "xxxxxxxxxxxxxxMYKEYxxxxxxxxxxxxxxx",
'x-rapidapi-host': "dark-sky.p.rapidapi.com"}
response = requests.request("GET", url, headers=headers)
data = response.json()
weather = data['currently']
weather = pd.DataFrame(weather, index=[0])
I would like to iterating through my dataset (10000 rows) and creating a new dataset with all the corresponding weather data for each row.
append()) and later convert it toDataFrame