weather data extraction using Pandas and visualization using Plotly

80 views
Skip to first unread message

Sebastian M Cheung

unread,
Aug 20, 2015, 12:29:37 PM8/20/15
to PyData
How to extract weather from this api and use Plotly to visualize weather data:

I understand this would get historical data for past 15 days..

http://api.openweathermap.org/data/2.5/history/city?q=Paris,FR&type=hour&start=1369728000&end=1369789200

Thanks


Sebastian M Cheung

unread,
Aug 20, 2015, 2:20:18 PM8/20/15
to PyData
 
Specifically I want to extract say from Paris, FR the latitude and longitude:

2.34880, 48.853409

which is embedded as id 2988507 Paris 2.34880 58.853409, at the moment it is hardcored and provided

(lon, lat) = (2.34880, 48.853409)  # Paris


 

Tony Whittaker

unread,
Aug 20, 2015, 7:43:39 PM8/20/15
to pyd...@googlegroups.com
Your data appears to be in JSON format. In terms of how to work with it, I would look at the python documentation for parsing JSON: https://docs.python.org/3.4/library/json.html

Alternatively if you intend to do more complicated analysis, pandas read_json may be helpful: http://pandas.pydata.org/pandas-docs/stable/io.html#io-json-reader



--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Tony Whittaker

Joris Van den Bossche

unread,
Aug 21, 2015, 6:52:40 AM8/21/15
to PyData
If you search for 'openweathermap python', you can find some different projects providing a python interface to download the data. That could maybe also help.

https://github.com/csparpa/pyowm
https://github.com/marians/openweather
https://github.com/scls19fr/openweathermap_requests
Reply all
Reply to author
Forward
0 new messages