SlideShare a Scribd company logo
A. Jesse Jiryu Davis
#MongoDBWorld
The Weather of the Century!
Part III:!
Visualization
Senior Python Engineer, MongoDB
Serious MongoDB Talk
Serious MongoDB Talk
Database
Serious MongoDB Talk
This Talk
Where’s the data from?
Where’s the data from?
How Much Is There?
Deployment
Visualization
Visualization Pipeline
MongoDB PyMongo NumPy Matplotlib
Python
dicts
SciPy
import numpy!
import pymongo!
!
data = []!
db = pymongo.MongoClient().my_database!
!
for doc in db.collection.find(query):!
data.append((!
doc['position']['coordinates'][0],!
doc['position']['coordinates'][1],!
doc['airTemperature']['value']))!
!
arrays = numpy.array(data)!
# NumPy column access syntax.!
lons = arrays[:, 0]!
lats = arrays[:, 1]!
temps = arrays[:, 2]!
The Weather of the Century Part 3: Visualization
from scipy import griddata!
from matplotlib import pyplot!
!
xs = numpy.linspace(-180, 180, 361)!
ys = numpy.linspace(-90, 90, 181)!
zs = griddata(lats, lons, temps,!
(xs, ys),!
method='linear')!
!
pyplot.contour(xs, ys, zs)!
Magic!!
Also magic!!
The Weather of the Century Part 3: Visualization
from matplotlib import pyplot!
!
xs = numpy.linspace(-180, 180, 361)!
ys = numpy.linspace(-90, 90, 181)!
zs = griddata(lats, lons, temps,!
(xs, ys),!
method='linear')!
!
pyplot.contour(xs, ys, zs)!
Triangulation
Triangulation
What temperature?
Triangulation
Barycentric Interpolation
What temperature? 53
48
54
Weighted Average
51.1
Interpolation
51.1
Interpolation
Interpolation
Contours
Contours
The Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: Visualization
import numpy!
import pymongo!
!
data = []!
db = pymongo.MongoClient().my_database!
!
for doc in db.collection.find(query):!
data.append((!
doc['position']['coordinates'][0],!
doc['position']['coordinates'][1],!
doc['airTemperature']['value']))!
!
arrays = numpy.array(data)!
Not terrifically fast
Analyzing large datasets
• Querying: 109k documents per second
• (On localhost)
• Can we go faster?
• Enter“Monary”
MongoDB PyMongo NumPy Matplotlib
Python
dicts
MongoDB Monary NumPy Matplotlib
Monary
by David Beach
import monary!
!
data = []!
connection = monary.Monary()!
!
arrays = monary_connection.query(!
db='my_database',!
coll='collection',!
query=query,!
fields=['lon', 'lat', 'temp'],!
types=[!
'float32', 'float32', 'float32'])!
Monary
• PyMongo: 109k documents per second
• Monary: 817k documents per second
Visualization
{!
ts: ISODate("1991-01-01T00:00:00Z"),!
position: {!
type: "Point",!
coordinates: [!
-94.6,!
39.117!
]!
},!
airTemperature: {!
value: 45,!
quality: "1"!
}!
}!
Original Schema
{!
ts: ISODate("1991-01-01T00:00:00Z"),!
lon: 39.117,!
lat: -94.6,!
temp: 45!
}!
Target Schema
Future of Monary
• Author:

David Beach
• Interns:

Kyle Suarez

Matt Cotter
• Mentors:

A.Jesse Jiryu Davis

Jason Carey
Future of Monary
• Subdocuments:
"airTemperature.value"
• Aggregation cursor
• Packaging
• Bugfixes
• Python 3
Thanks
• Monary
• NumPy
• SciPy
• Matplotlib
Thanks
Thank you
#MongoDBWorld
A. Jesse Jiryu Davis
Senior Python Engineer, MongoDB

More Related Content

PPTX
Weather of the Century: Visualization
PPTX
Weather of the Century: Design and Performance
PPTX
The Weather of the Century Part 2: High Performance
PDF
Using PyPy instead of Python for speed
PPTX
Deep dumpster diving 2010
PDF
AJUG April 2011 Raw hadoop example
PDF
MongoDB World 2019: Event Horizon: Meet Albert Einstein As You Move To The Cloud
PDF
Network Analysis with networkX : Real-World Example-2
Weather of the Century: Visualization
Weather of the Century: Design and Performance
The Weather of the Century Part 2: High Performance
Using PyPy instead of Python for speed
Deep dumpster diving 2010
AJUG April 2011 Raw hadoop example
MongoDB World 2019: Event Horizon: Meet Albert Einstein As You Move To The Cloud
Network Analysis with networkX : Real-World Example-2

What's hot (20)

PDF
Network Analysis with networkX : Real-World Example-1
PDF
Блохин Леонид - "Mist, как часть Hydrosphere"
PPTX
Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Goo...
PDF
R and cpp
PDF
Sea Amsterdam 2014 November 19
PDF
Azure Stream Analytics Project : On-demand real-time analytics
TXT
Code
PPT
Heapsort
DOCX
R Data Visualization-Spatial data and Maps in R: Using R as a GIS
PDF
k-means algorithm implementation on Hadoop
PDF
Boosting command line experience with python and awk
PPTX
The easiest consistent hashing
PDF
Ganga: an interface to the LHC computing grid
PDF
MongoDB Project: Relational databases to Document-Oriented databases
PDF
Cloud flare jgc bigo meetup rolling hashes
PPTX
Ac cuda c_5
PPTX
CloudClustering: Toward a scalable machine learning toolkit for Windows Azure
PDF
Queue in swift
PPT
chapter - 6.ppt
Network Analysis with networkX : Real-World Example-1
Блохин Леонид - "Mist, как часть Hydrosphere"
Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Goo...
R and cpp
Sea Amsterdam 2014 November 19
Azure Stream Analytics Project : On-demand real-time analytics
Code
Heapsort
R Data Visualization-Spatial data and Maps in R: Using R as a GIS
k-means algorithm implementation on Hadoop
Boosting command line experience with python and awk
The easiest consistent hashing
Ganga: an interface to the LHC computing grid
MongoDB Project: Relational databases to Document-Oriented databases
Cloud flare jgc bigo meetup rolling hashes
Ac cuda c_5
CloudClustering: Toward a scalable machine learning toolkit for Windows Azure
Queue in swift
chapter - 6.ppt
Ad

Similar to The Weather of the Century Part 3: Visualization (20)

PDF
The Weather of the Century
PDF
A Century Of Weather Data - Midwest.io
PPTX
Open Source Mapping with Python, and MongoDB
PDF
MongoSF - Spatial MongoDB in OpenShift - script file
PDF
MongoDB and Python
PDF
Using MongoDB and Python
PDF
2016 feb-23 pyugre-py_mongo
PDF
Webinar: Data Processing and Aggregation Options
PDF
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDB
PPTX
MongoDB 3.4 webinar
PDF
Python and MongoDB
PPTX
Querying mongo db
PDF
Mongo db 3.4 Overview
PDF
OSDC 2012 | Building a first application on MongoDB by Ross Lawley
PPTX
MongoDB 3.4: Deep Dive on Views, Zones, and MongoDB Compass
PPTX
Getting Started with Geospatial Data in MongoDB
PPTX
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
PDF
Mongo db halloween party
PDF
Data Processing and Aggregation with MongoDB
PPTX
Webinar: MongoDB Use Cases within the Oil, Gas, and Energy Industries
The Weather of the Century
A Century Of Weather Data - Midwest.io
Open Source Mapping with Python, and MongoDB
MongoSF - Spatial MongoDB in OpenShift - script file
MongoDB and Python
Using MongoDB and Python
2016 feb-23 pyugre-py_mongo
Webinar: Data Processing and Aggregation Options
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDB
MongoDB 3.4 webinar
Python and MongoDB
Querying mongo db
Mongo db 3.4 Overview
OSDC 2012 | Building a first application on MongoDB by Ross Lawley
MongoDB 3.4: Deep Dive on Views, Zones, and MongoDB Compass
Getting Started with Geospatial Data in MongoDB
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Mongo db halloween party
Data Processing and Aggregation with MongoDB
Webinar: MongoDB Use Cases within the Oil, Gas, and Energy Industries
Ad

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...

Recently uploaded (20)

PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
A Presentation on Touch Screen Technology
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
1. Introduction to Computer Programming.pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Encapsulation theory and applications.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
project resource management chapter-09.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Hindi spoken digit analysis for native and non-native speakers
A Presentation on Touch Screen Technology
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Programs and apps: productivity, graphics, security and other tools
Zenith AI: Advanced Artificial Intelligence
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
1. Introduction to Computer Programming.pptx
cloud_computing_Infrastucture_as_cloud_p
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
A novel scalable deep ensemble learning framework for big data classification...
project resource management chapter-09.pdf
A comparative study of natural language inference in Swahili using monolingua...
Digital-Transformation-Roadmap-for-Companies.pptx
Approach and Philosophy of On baking technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Group 1 Presentation -Planning and Decision Making .pptx
MIND Revenue Release Quarter 2 2025 Press Release

The Weather of the Century Part 3: Visualization