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
Name of df column where pollutanat values are stored
Reason:
As pollutant attribute will also contain the value for it, hence we do not require to take another parameter for it which is dataloc the alone pollutant will contain Name of pollutant and Name of df column where pollutant values are stored
Solution:
Considering the above reasons in mind, dataloc as a parameter should be removed from the method signature.
The new method signature should look like:
defgoogleMaps(df, lat, long, pollutant):
Issue-2: Allowing user-provided date in the code instead of a predefined date
Here, date is hardcoded as 2018-05-07 which should be taken from user.
Further more, in other plots(timePlot, calendarPlot etc.) the column name is date in source code and here is Date Local which can create confusion to the user, hence it should be date
Solution:
defgoogleMaps(df, lat, long, pollutant, date)
.....
.........
some_value=datedf=df.loc[df['date'] ==some_value]
.........
For which the new method signature should look like: def googleMaps(df, lat, long, pollutant, date)
Considering above reasons, removing dataloc with date as parameter of function should be more feasible.
Example:
defgoogleMaps(df, lat, long, pollutant, date):
df1=dfprint(date)
df1=df[df['date']==date]
print(df1)
#colordict = {45: "lightblue", 100: "lightgreen", 150: "orange", 200: "red"}lat=28.815329long=77.153010my_map4=folium.Map(location= [lat, long], zoom_start=10)
#df['station'] should be the name of the place/air stationforlat,long,pol,stinzip(df['latitude'],df['longitude'],df[pollutant],df['station']):
folium.CircleMarker([lat, long],radius=0.01*pol, popup=(str(st).capitalize()+"<br>"+str(pol)), fill=True, fill_opacity=0.7, color='red').add_to(my_map4)
my_map4.save("googleMaps.html")
print('your map has been saved')
googleMaps(df, 'latitude', 'longitude', 'pm25', '2022-02-23')
Output:
The text was updated successfully, but these errors were encountered:
@nipunbatra , @patel-zeel
Bug:
Expecting
Parameter Name
column for pollutant name in the code.(It expects a column filled with pollutant name.)Code:
Error:
Issue-1:
Source Code:
vayu/vayu/googleMaps.py
Lines 38 to 39 in ef99aef
It expects a whole column filled with
pm25
or anypollutant name
like:The above isn't possible and feasible in any quality dataset.
The ideal pollutant column in any dataset looks like below:
Hence
dataloc
parameter should be removed from the signature.vayu/vayu/googleMaps.py
Lines 17 to 21 in ef99aef
Reason:
As
pollutant
attribute will also contain the value for it, hence we do not require to take another parameter for it which isdataloc
the alonepollutant
will containName of pollutant
andName of df column where pollutant values are stored
Solution:
Considering the above reasons in mind,
dataloc
as a parameter should be removed from the method signature.The new method signature should look like:
Issue-2: Allowing user-provided date in the code instead of a predefined date
Source Code:
vayu/vayu/googleMaps.py
Lines 41 to 42 in ef99aef
Here,
date
is hardcoded as2018-05-07
which should be taken from user.Further more, in other plots(timePlot, calendarPlot etc.) the column name is
date
in source code and here isDate Local
which can create confusion to the user, hence it should bedate
Solution:
For which the new method signature should look like:
def googleMaps(df, lat, long, pollutant, date)
Considering above reasons, removing
dataloc
withdate
as parameter of function should be more feasible.Example:
Output:
The text was updated successfully, but these errors were encountered: