# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import pandas as pd
from datetime import date
import matplotlib.pyplot as plt

city_df=pd.read_csv('cities.csv')

city_df


def plotting(y_col,df=city_df,x_col='Lat',time='01/05/17',font=15,pad=20,font_w="bold"):
    plt.figure(figsize=(10,7))
    plt.scatter(df[x_col],df[y_col], facecolors="#288da3", edgecolors="black" ,s=65)
    plt.xlabel('Latitude')
    plt.grid()
    if y_col=='Max Temp':
        plt.ylabel('Max Temperature(F)')
        plt.title(f'City Latitude vs Max Temperature ({time})',fontsize= font,pad=pad,\
                  fontweight=font_w)
        plt.savefig('assets/images/max-Temp.png')
    elif y_col=='Humidity':
        plt.ylabel('Humidity(%)')
        plt.title(f'City Latitude vs Humidity ({time})',fontsize= font,pad=pad,fontweight=font_w)
        plt.savefig('assets/images/Humidity.png') 
    elif y_col=='Cloudiness':
        plt.ylabel('Cloudiness(%)')
        plt.title(f'City Latitude vs Cloudiness ({time})',fontsize= font,pad=pad,fontweight=font_w)
        plt.savefig('assets/images/Cloudiness.png') 
    elif y_col=='Wind Speed':
        plt.ylabel('Wind Speed(mph)')
        plt.title(f'City Latitude vs Wind Speed ({time})',fontsize= font,pad=pad,fontweight=font_w)
        plt.savefig('assets/images/Lat_wind.png')
    plt.show()
        


plotting(y_col='Max Temp')

plotting(y_col='Humidity')

plotting(y_col='Cloudiness')

plotting(y_col='Wind Speed')

city_df=pd.read_csv('cities.csv')

city_df.set_index("City_ID", inplace=True)

city_df

city_df.to_html("../data.html")





StarcoderdataJupyterScriptsDedupFiltered