u/Practical-Chance-396

Derived variables for a weather dataset in forecasting ml model

Hello guys! I’m going to analyse a dataset which will be applied in my weather forecasting machine learning model. The variables the dataset holding are below. Is there any other derived variables i could add in, to help the dataset more meteorologic professional. And i suppose if i stuff the decent variables into my model, it would perform better. Any advice?

variables=[
    'temperature_2m',
    'relative_humidity_2m',
    'dew_point_2m',
    'apparent_temperature',
    'pressure_msl',


    'cloud_cover',
    'cloud_cover_low',
    'cloud_cover_mid',
    'cloud_cover_high',


    'wind_speed_10m',
    'wind_direction_10m',
    'wind_gusts_10m',


    'shortwave_radiation',
    'direct_radiation',
    'diffuse_radiation',
    'global_tilted_irradiance',
    'vapour_pressure_deficit',
    'cape',
    'evapotranspiration',
    'et0_fao_evapotranspiration',


    'precipitation',
    'snowfall',
    'rain',
    'showers',
    'visibility',
    'is_day',
]
reddit.com
u/Practical-Chance-396 — 22 hours ago

Derived variables for a weather dataset in forecasting ml model

Hello guys! I’m going to analyse a dataset which will be applied in my weather forecasting machine learning model. The variables the dataset holding are below. Is there any other derived variables i could add in, to help the dataset more meteorologic professional. And i suppose if i stuff the decent variables into my model, it would perform better. Any advice?

variables=[
    'temperature_2m',
    'relative_humidity_2m',
    'dew_point_2m',
    'apparent_temperature',
    'pressure_msl',


    'cloud_cover',
    'cloud_cover_low',
    'cloud_cover_mid',
    'cloud_cover_high',


    'wind_speed_10m',
    'wind_direction_10m',
    'wind_gusts_10m',


    'shortwave_radiation',
    'direct_radiation',
    'diffuse_radiation',
    'global_tilted_irradiance',
    'vapour_pressure_deficit',
    'cape',
    'evapotranspiration',
    'et0_fao_evapotranspiration',


    'precipitation',
    'snowfall',
    'rain',
    'showers',
    'visibility',
    'is_day',
]
reddit.com
u/Practical-Chance-396 — 22 hours ago
▲ 0 r/travel

Make full use of the 6h55min in Istanbul

Hello guys! I'm going to take a flight from beijing to paris, with a 6h55min layover in Itanbul. Since i'm always intersted in the famous city, how can i make full use of this 6h55min stay? I‘m not familiar with the practical staff in Istanbul pretty much, not at all precisely. Is it safe for me to hang around in the centre of Istanbul during the "dangreous" interval?(free from visa worries). btw this is my first time going aboard an totally on my own.

reddit.com
u/Practical-Chance-396 — 2 days ago

Invalid string value while calling APIs

Hello guys! As i am a freshman in college and trying calling a weather data api from open-meteo for my little machine learning project, this problem struck me and i was trapped here for a few days! Help!

Error shown in the terminal:

(base) byteux@byteux:~/Desktop/PWF/PWF-trial1$ python main.py

Fetching data from 1984-01-01 to 1984-01-07...

status code: 400

response snippet:

{'reason': "Data corrupted at path ''. Cannot initialize SurfacePressureAndHeightVariable<VariableAndPreviousDay, VariableOrSpread<ForecastPressureVariable>, ForecastHeightVariable> from invalid String value temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,pressure_msl,cloudcover,cloudcover_low,cloudcover_mid,cloudcover_high,wind_speed_10m,wind_direction_10m,wind_gust_10m,shortwave_radiation,direct_radiation,diffuse_radiation,global_tilted_irradiance,vapour_pressure_deficit,cape,evapotranspiration,et0_fao_evapotranspiration,precipitation,snowfall,precipitation_probability,rain,showers,visibility,is_day.", 'error': True}

API deploying failed

Traceback (most recent call last):

File "/home/byteux/Desktop/PWF/PWF-trial1/main.py", line 16, in <module>

main()

~~~~^^

File "/home/byteux/Desktop/PWF/PWF-trial1/main.py", line 11, in main

records=parse_weather_data(data)

File "/home/byteux/Desktop/PWF/PWF-trial1/weather_api.py", line 67, in parse_weather_data

hourly=data['hourly']

~~~~^^^^^^^^^^

TypeError: 'NoneType' object is not subscriptable

and i believe the most critical part in this "Error" is: {'reason': "Data corrupted at path ''. Cannot initialize SurfacePressureAndHeightVariable<VariableAndPreviousDay, VariableOrSpread<ForecastPressureVariable>, ForecastHeightVariable> from invalid String value Here is my code below (weather_api.py):

import requests

from datetime import datetime, timedelta

variables=[

'temperature_2m',

'relative_humidity_2m',

'dew_point_2m',

'apparent_temperature',

'pressure_msl',

'cloudcover',

'cloudcover_low',

'cloudcover_mid',

'cloudcover_high',

'wind_speed_10m',

'wind_direction_10m',

'wind_gust_10m',

'shortwave_radiation',

'direct_radiation',

'diffuse_radiation',

'global_tilted_irradiance',

'vapour_pressure_deficit',

'cape',

'evapotranspiration',

'et0_fao_evapotranspiration',

'precipitation',

'snowfall',

'precipitation_probability',

'rain',

'showers',

'visibility',

'is_day',

]

def fetch_range(start_date,end_date):

url='https://archive-api.open-meteo.com/v1/archive'

params={

'latitude':48.85,

'longitude':2.35,

'start_date':start_date,

'end_date':end_date,

'wind_speed_unit':'ms',

'hourly':','.join(variables),

'timezone':'Europe/Paris'

}

try:

response=requests.get(url,params=params,timeout=100)

print("status code: ",response.status_code)

print("response snippet:\n",response.json())

if response.status_code!=200:

print(f"API deploying failed")

return None

data=response.json()

if 'hourly' not in data:

print("Missing 'hourly' in response")

return None

return data

except requests.exceptions.RequestException as e:

print(f"Request failed")

return None

def parse_weather_data(data):

hourly=data['hourly']

times=hourly['time']

records=[]

for i in range(len(times)):

row=[times[i]]

for v in variables:

values=hourly.get(v)

if values: row.append(values[i])

else: row.append(None)

records.append(tuple(row))

and main.py

from weather_api import *

from database import *

def main():

create_table()

start_date='1984-01-01'

end_date='1984-01-07'

print(f"Fetching data from {start_date} to {end_date}...")

data=fetch_range(start_date,end_date)

records=parse_weather_data(data)

insert_records(records)

print(f"Done. {len(records)} rows inserted.")

if __name__=="__main__":

main()

reddit.com
u/Practical-Chance-396 — 4 days ago