You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While exploring this package I tried calendarPlot, and the plot for January and December was not correct. (The beginning days of Jan and Dec is wrong) Also, the plot for Jan and Dec is same, which isn't possible.
Code:
importnumpyasnpimportpandasaspdnp.random.seed(42)
start_date=pd.to_datetime('2022-01-01')
end_date=pd.to_datetime('2022-12-31')
dates=pd.date_range(start_date, end_date)
pm25_values=np.random.rand(365) # Generate 365 random valuesws_values=np.random.rand(365)
wd_values=np.random.rand(365)
df=pd.DataFrame({
'date': dates,
'pm25': pm25_values,
'ws': ws_values,
'wd': wd_values
})
df['date'] =df['date'].dt.strftime('%Y-%m-%d') # Convert date format to 'YYYY-MM-DD'fromvayu.calendarPlotimportcalendarPlotcalendarPlot(df, 'pm25', '2022','India')`
Here, first 1 represents the month value, second 1 represents the day value.
In this case, month value is hardcoded as 1, indicating January for December plot,
Solution:
Hence, month value 1 should be replaced with t
Additionally, we don't require while i <= 1: this while loop, as we already have a parent while loop which is while t <= 12:
The text was updated successfully, but these errors were encountered:
Jan and Dec plots aspect ratio is incorrect
While exploring this package I tried calendarPlot, and the plot for January and December was not correct. (The beginning days of Jan and Dec is wrong) Also, the plot for Jan and Dec is same, which isn't possible.
Code:
Output:
Source Code:
vayu/vayu/calendarPlot.py
Lines 114 to 133 in ef99aef
Explaination:
Here, first
1
represents the month value, second1
represents the day value.In this case, month value is hardcoded as 1, indicating January for December plot,
Solution:
Hence, month value 1 should be replaced with
t
Additionally, we don't require
while i <= 1:
this while loop, as we already have a parent while loop which iswhile t <= 12:
The text was updated successfully, but these errors were encountered: