Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select_by: snake_case and typehints (refer issue #53) #60

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
added typehints and snake_case
Tanvi-Jain01 committed Jul 10, 2023

Verified

This commit was signed with the committer’s verified signature.
commit 9ef916ec188d7361a414a159b6055c252bea2e8c
17 changes: 9 additions & 8 deletions vayu/timePlot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
def timePlot(df, year, pollutants=["pm25"]):
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import plotly.graph_objects as go

def time_plot(df:pd.DataFrame, year:str, pollutants:list=["pm25"]):
"""
Plot time series of pollutants for given month and year.
@@ -12,12 +18,7 @@ def timePlot(df, year, pollutants=["pm25"]):
pollutants: list
column names of pollutatnts to compare
"""
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import plotly.graph_objects as go


# Cuts the df down to the month specified
df.index = pd.to_datetime(df.date)
df_n_1 = df[(df.index.year == int(year))]
@@ -64,6 +65,6 @@ def timePlot(df, year, pollutants=["pm25"]):
fig.show()

#Example:
#timePlot(df, 2022, pollutants=['pm25','pm10','ws','wd'...and so on])
#time_plot(df, 2022, pollutants=['pm25','pm10','ws','wd'...and so on])
#--------------------