diff --git a/requirements.txt b/requirements.txt index 78d1b7b..d671daa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,7 @@ certifi==2025.1.31 cffi==1.17.1 charset-normalizer==3.4.1 comm==0.2.2 -contourpy==1.3.1 +contourpy==1.2.0 cycler==0.12.1 debugpy==1.8.13 decorator==5.2.1 @@ -27,6 +27,7 @@ httpcore==1.0.7 httpx==0.28.1 idna==3.10 ipykernel==6.29.5 +ipympl==0.9.7 ipython==9.0.1 ipython_pygments_lexers==1.1.1 ipywidgets==8.1.5 @@ -54,6 +55,7 @@ kiwisolver==1.4.8 MarkupSafe==3.0.2 matplotlib==3.10.1 matplotlib-inline==0.1.7 +missingno==0.5.2 mistune==3.1.2 narwhals==1.29.0 nbclient==0.10.2 @@ -62,7 +64,7 @@ nbformat==5.10.4 nest-asyncio==1.6.0 notebook==7.3.2 notebook_shim==0.2.4 -numpy==2.2.3 +numpy==1.26.4 overrides==7.7.0 packaging==24.2 pandas==2.2.3 @@ -92,6 +94,7 @@ requests==2.32.3 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rpds-py==0.23.1 +scipy==1.15.2 seaborn==0.13.2 Send2Trash==1.8.3 setuptools==75.8.2 diff --git a/src/my_package/get_record.py b/src/my_package/get_record.py new file mode 100644 index 0000000..7071615 --- /dev/null +++ b/src/my_package/get_record.py @@ -0,0 +1,23 @@ +import pandas as pd + +def get_records(df, city_name): + if df.empty: + print("df is empty") + + else: + max_temp_mean = df['temp.mean_celsius'].max() + min_temp_mean = df['temp.mean_celsius'].min() + + max_temp = df['temp.record_max'].max() - 272.15 + min_temp = df['temp.record_min'].min() - 272.15 + + summary_data = { + "Metric": ["Max Temp mean (°C)", "Min Temp Mean (°C)", "Max Temp (°C)", "Min temp (°C)"], + "Values": [max_temp_mean, min_temp_mean, max_temp, min_temp] + } + + summary_df = pd.DataFrame(summary_data) + folder = "../data/output_record" + filename = f"records_{city_name}" + + return summary_df, filename, folder \ No newline at end of file