SlideShare a Scribd company logo
●
●
●
●
●
latitude
longitude
time
●
●
●
●
●
●
●
●
●
●
DataArray
○
○
○
○
Dataset
○ DataArray
○
time
longitude
latitude
land_coverelevation
>>> ds
<xray.Dataset>
Dimensions: (time: 10, latitude: 8, longitude: 8)
Coordinates:
* time (time) datetime64 2015-01-01 2015-01-02 2015-01-03 2015-01-04 ...
* latitude (latitude) float64 50.0 47.5 45.0 42.5 40.0 37.5 35.0 32.5
* longitude (longitude) float64 -105.0 -102.5 -100.0 -97.5 -95.0 -92.5 ...
elevation (longitude, latitude) int64 201 231 582 239 1848 1004 1004 ...
land_cover (longitude, latitude) object 'forest' 'urban' 'farmland'...
Data variables:
temperature (time, longitude, latitude) float64 13.7 8.031 18.36 24.95 ...
pressure (time, longitude, latitude) float64 1.374 1.142 1.388 0.9992 ...
# numpy style
ds.temperature[0, :, :]
# pandas style
ds.temperature.loc[:, -90, 50]
# with dimension names
ds.sel(time='2015-01-01')
ds.sel(longitude=-90, latitude=50, method='nearest')
# math
(10 + ds) ** 0.5
ds.temperature + ds.pressure
np.sin(ds.temperature)
# aggregation
ds.mean(dim='time')
ds.max(dim=['latitude', 'longitude'])
time
time
space
space
+ =
Result has the union of all dimension names
year
+ =
Result has the intersection of coordinate labels
2000
2001
2002
2003
2004
2005
2006
2007
2008
X
X
X
X
X
# average by calendar month
ds.groupby('time.month').mean('time')
# resample to every 10 days
ds.resample('10D', dim='time', how='max')
# xray -> numpy
ds.temperature.values
# xray -> pandas
ds.to_dataframe()
# pandas -> xray
xray.Dataset.from_dataframe(df)
>>> ds = xray.open_mfdataset('/Users/shoyer/data/era-interim/*.nc')
>>> ds
<xray.Dataset>
Dimensions: (latitude: 256, longitude: 512, time: 52596)
Coordinates:
* latitude (latitude) float32 89.4628 88.767 88.067 87.3661 86.6648 ...
* longitude (longitude) float32 0.0 0.703125 1.40625 2.10938 2.8125 ...
* time (time) datetime64[ns] 1979-01-01 1979-01-01T06:00:00 ...
Data variables:
t2m (time, latitude, longitude) float64 240.6 240.6 240.6 ...
>>> ds.nbytes * (2 ** -30)
51.363675981760025
ds_by_season = ds.groupby('time.season').mean('time')
t2m_range = abs(ds_by_season.sel(season='JJA')
- ds_by_season.sel(season='DJF')).t2m
%time result = t2m_range.load()
CPU times: user 2min 1s, sys: 49.5 s, total: 2min 51s
Wall time: 38.6 s
More details: continuum.io/blog/xray-dask
pandas: indexing, factorize
NumPy: arrays
netCDF4, h5py, SciPy: IO
dask.array: out of core arrays
xray at SciPy 2015

More Related Content

What's hot

Quantum espresso G Vector distributon
Quantum espresso G Vector distributonQuantum espresso G Vector distributon
Quantum espresso G Vector distributon
Eric Pascolo
 
5.1 vertex y int zeros d r
5.1 vertex y int zeros d r5.1 vertex y int zeros d r
5.1 vertex y int zeros d r
andreagoings
 
8.7 numerical integration
8.7 numerical integration8.7 numerical integration
8.7 numerical integration
dicosmo178
 
8th PreAlg - L74--April12
8th PreAlg - L74--April128th PreAlg - L74--April12
8th PreAlg - L74--April12
jdurst65
 
Ch17 25
Ch17 25Ch17 25
Ch17 25
schibu20
 
Ejercicio1
Ejercicio1Ejercicio1
Ejercicio1
Miguel Silva
 
Basic Scientific notation problems
Basic Scientific notation problemsBasic Scientific notation problems
Basic Scientific notation problems
Nong Aquino jr.
 
Python Lecture 12
Python Lecture 12Python Lecture 12
Python Lecture 12
Inzamam Baig
 
Halus hukumlinear
Halus hukumlinearHalus hukumlinear
Halus hukumlinear
Mohd Noor Hisham Muhamad
 
Practica productos notables
Practica productos notablesPractica productos notables
Practica productos notables
Lina Ari
 
Capinha de matemática
Capinha de matemáticaCapinha de matemática
Capinha de matemática
Atividades Diversas Cláudia
 
MNISTデータセットを用いたCNNの実装
MNISTデータセットを用いたCNNの実装MNISTデータセットを用いたCNNの実装
MNISTデータセットを用いたCNNの実装
ManaMasuda
 
Ejercicios de ecuaciones diferenciales
Ejercicios  de ecuaciones diferencialesEjercicios  de ecuaciones diferenciales
Ejercicios de ecuaciones diferenciales
Jimena Perez
 

What's hot (13)

Quantum espresso G Vector distributon
Quantum espresso G Vector distributonQuantum espresso G Vector distributon
Quantum espresso G Vector distributon
 
5.1 vertex y int zeros d r
5.1 vertex y int zeros d r5.1 vertex y int zeros d r
5.1 vertex y int zeros d r
 
8.7 numerical integration
8.7 numerical integration8.7 numerical integration
8.7 numerical integration
 
8th PreAlg - L74--April12
8th PreAlg - L74--April128th PreAlg - L74--April12
8th PreAlg - L74--April12
 
Ch17 25
Ch17 25Ch17 25
Ch17 25
 
Ejercicio1
Ejercicio1Ejercicio1
Ejercicio1
 
Basic Scientific notation problems
Basic Scientific notation problemsBasic Scientific notation problems
Basic Scientific notation problems
 
Python Lecture 12
Python Lecture 12Python Lecture 12
Python Lecture 12
 
Halus hukumlinear
Halus hukumlinearHalus hukumlinear
Halus hukumlinear
 
Practica productos notables
Practica productos notablesPractica productos notables
Practica productos notables
 
Capinha de matemática
Capinha de matemáticaCapinha de matemática
Capinha de matemática
 
MNISTデータセットを用いたCNNの実装
MNISTデータセットを用いたCNNの実装MNISTデータセットを用いたCNNの実装
MNISTデータセットを用いたCNNの実装
 
Ejercicios de ecuaciones diferenciales
Ejercicios  de ecuaciones diferencialesEjercicios  de ecuaciones diferenciales
Ejercicios de ecuaciones diferenciales
 

Viewers also liked

New Capabilities in the PyData Ecosystem
New Capabilities in the PyData EcosystemNew Capabilities in the PyData Ecosystem
New Capabilities in the PyData Ecosystem
Turi, Inc.
 
Numba Overview
Numba OverviewNumba Overview
Numba Overview
stan_seibert
 
Numba
NumbaNumba
Fast and Scalable Python
Fast and Scalable PythonFast and Scalable Python
Fast and Scalable Python
Travis Oliphant
 
Numba: Flexible analytics written in Python with machine-code speeds and avo...
Numba:  Flexible analytics written in Python with machine-code speeds and avo...Numba:  Flexible analytics written in Python with machine-code speeds and avo...
Numba: Flexible analytics written in Python with machine-code speeds and avo...
PyData
 
IPython & Jupyter
IPython & JupyterIPython & Jupyter
IPython & Jupyter
Big Data Colombia
 

Viewers also liked (6)

New Capabilities in the PyData Ecosystem
New Capabilities in the PyData EcosystemNew Capabilities in the PyData Ecosystem
New Capabilities in the PyData Ecosystem
 
Numba Overview
Numba OverviewNumba Overview
Numba Overview
 
Numba
NumbaNumba
Numba
 
Fast and Scalable Python
Fast and Scalable PythonFast and Scalable Python
Fast and Scalable Python
 
Numba: Flexible analytics written in Python with machine-code speeds and avo...
Numba:  Flexible analytics written in Python with machine-code speeds and avo...Numba:  Flexible analytics written in Python with machine-code speeds and avo...
Numba: Flexible analytics written in Python with machine-code speeds and avo...
 
IPython & Jupyter
IPython & JupyterIPython & Jupyter
IPython & Jupyter
 

Similar to xray at SciPy 2015

LS1.pptx
LS1.pptxLS1.pptx
LS1.pptx
AbishekR29
 
Données hospitalières relatives à l'épidémie de COVID-19 FRANCE
Données hospitalières relatives à l'épidémie de COVID-19 FRANCEDonnées hospitalières relatives à l'épidémie de COVID-19 FRANCE
Données hospitalières relatives à l'épidémie de COVID-19 FRANCE
Nalron
 
Apache Cassandra for Timeseries- and Graph-Data
Apache Cassandra for Timeseries- and Graph-DataApache Cassandra for Timeseries- and Graph-Data
Apache Cassandra for Timeseries- and Graph-Data
Guido Schmutz
 
Project presentation(View calender)
Project presentation(View calender)Project presentation(View calender)
Project presentation(View calender)
Ikhtiar Khan Sohan
 
Paul Dix [InfluxData] The Journey of InfluxDB | InfluxDays 2022
Paul Dix [InfluxData] The Journey of InfluxDB | InfluxDays 2022Paul Dix [InfluxData] The Journey of InfluxDB | InfluxDays 2022
Paul Dix [InfluxData] The Journey of InfluxDB | InfluxDays 2022
InfluxData
 
Time Series.pptx
Time Series.pptxTime Series.pptx
Time Series.pptx
Ramakrishna Reddy Bijjam
 
Brace yourselves, leap second is coming
Brace yourselves, leap second is comingBrace yourselves, leap second is coming
Brace yourselves, leap second is coming
Nati Cohen
 
Computer Science Presentation for various MATLAB toolboxes
Computer Science Presentation for various MATLAB toolboxesComputer Science Presentation for various MATLAB toolboxes
Computer Science Presentation for various MATLAB toolboxes
ThinHunh47
 
Coding matlab
Coding matlabCoding matlab
Coding matlab
MRSENKUMARRadhakrish
 
Coding matlab
Coding matlabCoding matlab
Coding matlab
MRSENKUMARRadhakrish
 
論文紹介:Is Space-Time Attention All You Need for Video Understanding?
論文紹介:Is Space-Time Attention All You Need for Video Understanding?論文紹介:Is Space-Time Attention All You Need for Video Understanding?
論文紹介:Is Space-Time Attention All You Need for Video Understanding?
Toru Tamaki
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
Sander Kieft
 
D3.js - A picture is worth a thousand words
D3.js - A picture is worth a thousand wordsD3.js - A picture is worth a thousand words
D3.js - A picture is worth a thousand words
Apptension
 
Fun with D3.js: Data Visualization Eye Candy with Streaming JSON
Fun with D3.js: Data Visualization Eye Candy with Streaming JSONFun with D3.js: Data Visualization Eye Candy with Streaming JSON
Fun with D3.js: Data Visualization Eye Candy with Streaming JSON
Tomomi Imura
 
Datastax day 2016 : Cassandra data modeling basics
Datastax day 2016 : Cassandra data modeling basicsDatastax day 2016 : Cassandra data modeling basics
Datastax day 2016 : Cassandra data modeling basics
Duyhai Doan
 
Cloudera - A Taste of random decision forests
Cloudera - A Taste of random decision forestsCloudera - A Taste of random decision forests
Cloudera - A Taste of random decision forests
Dataconomy Media
 
A Century Of Weather Data - Midwest.io
A Century Of Weather Data - Midwest.ioA Century Of Weather Data - Midwest.io
A Century Of Weather Data - Midwest.io
Randall Hunt
 
data_selectionOctober 19, 2022[1] # Data Selection.docx
data_selectionOctober 19, 2022[1] # Data Selection.docxdata_selectionOctober 19, 2022[1] # Data Selection.docx
data_selectionOctober 19, 2022[1] # Data Selection.docx
richardnorman90310
 
Using the python_data_toolkit_timbers_slides
Using the python_data_toolkit_timbers_slidesUsing the python_data_toolkit_timbers_slides
Using the python_data_toolkit_timbers_slides
Tiffany Timbers
 
Jsr310 - Java 8 Date and Time API
Jsr310 - Java 8 Date and Time APIJsr310 - Java 8 Date and Time API
Jsr310 - Java 8 Date and Time API
Ady Liu
 

Similar to xray at SciPy 2015 (20)

LS1.pptx
LS1.pptxLS1.pptx
LS1.pptx
 
Données hospitalières relatives à l'épidémie de COVID-19 FRANCE
Données hospitalières relatives à l'épidémie de COVID-19 FRANCEDonnées hospitalières relatives à l'épidémie de COVID-19 FRANCE
Données hospitalières relatives à l'épidémie de COVID-19 FRANCE
 
Apache Cassandra for Timeseries- and Graph-Data
Apache Cassandra for Timeseries- and Graph-DataApache Cassandra for Timeseries- and Graph-Data
Apache Cassandra for Timeseries- and Graph-Data
 
Project presentation(View calender)
Project presentation(View calender)Project presentation(View calender)
Project presentation(View calender)
 
Paul Dix [InfluxData] The Journey of InfluxDB | InfluxDays 2022
Paul Dix [InfluxData] The Journey of InfluxDB | InfluxDays 2022Paul Dix [InfluxData] The Journey of InfluxDB | InfluxDays 2022
Paul Dix [InfluxData] The Journey of InfluxDB | InfluxDays 2022
 
Time Series.pptx
Time Series.pptxTime Series.pptx
Time Series.pptx
 
Brace yourselves, leap second is coming
Brace yourselves, leap second is comingBrace yourselves, leap second is coming
Brace yourselves, leap second is coming
 
Computer Science Presentation for various MATLAB toolboxes
Computer Science Presentation for various MATLAB toolboxesComputer Science Presentation for various MATLAB toolboxes
Computer Science Presentation for various MATLAB toolboxes
 
Coding matlab
Coding matlabCoding matlab
Coding matlab
 
Coding matlab
Coding matlabCoding matlab
Coding matlab
 
論文紹介:Is Space-Time Attention All You Need for Video Understanding?
論文紹介:Is Space-Time Attention All You Need for Video Understanding?論文紹介:Is Space-Time Attention All You Need for Video Understanding?
論文紹介:Is Space-Time Attention All You Need for Video Understanding?
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
D3.js - A picture is worth a thousand words
D3.js - A picture is worth a thousand wordsD3.js - A picture is worth a thousand words
D3.js - A picture is worth a thousand words
 
Fun with D3.js: Data Visualization Eye Candy with Streaming JSON
Fun with D3.js: Data Visualization Eye Candy with Streaming JSONFun with D3.js: Data Visualization Eye Candy with Streaming JSON
Fun with D3.js: Data Visualization Eye Candy with Streaming JSON
 
Datastax day 2016 : Cassandra data modeling basics
Datastax day 2016 : Cassandra data modeling basicsDatastax day 2016 : Cassandra data modeling basics
Datastax day 2016 : Cassandra data modeling basics
 
Cloudera - A Taste of random decision forests
Cloudera - A Taste of random decision forestsCloudera - A Taste of random decision forests
Cloudera - A Taste of random decision forests
 
A Century Of Weather Data - Midwest.io
A Century Of Weather Data - Midwest.ioA Century Of Weather Data - Midwest.io
A Century Of Weather Data - Midwest.io
 
data_selectionOctober 19, 2022[1] # Data Selection.docx
data_selectionOctober 19, 2022[1] # Data Selection.docxdata_selectionOctober 19, 2022[1] # Data Selection.docx
data_selectionOctober 19, 2022[1] # Data Selection.docx
 
Using the python_data_toolkit_timbers_slides
Using the python_data_toolkit_timbers_slidesUsing the python_data_toolkit_timbers_slides
Using the python_data_toolkit_timbers_slides
 
Jsr310 - Java 8 Date and Time API
Jsr310 - Java 8 Date and Time APIJsr310 - Java 8 Date and Time API
Jsr310 - Java 8 Date and Time API
 

Recently uploaded

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 

Recently uploaded (20)

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 

xray at SciPy 2015

  • 1.
  • 2.
  • 8. >>> ds <xray.Dataset> Dimensions: (time: 10, latitude: 8, longitude: 8) Coordinates: * time (time) datetime64 2015-01-01 2015-01-02 2015-01-03 2015-01-04 ... * latitude (latitude) float64 50.0 47.5 45.0 42.5 40.0 37.5 35.0 32.5 * longitude (longitude) float64 -105.0 -102.5 -100.0 -97.5 -95.0 -92.5 ... elevation (longitude, latitude) int64 201 231 582 239 1848 1004 1004 ... land_cover (longitude, latitude) object 'forest' 'urban' 'farmland'... Data variables: temperature (time, longitude, latitude) float64 13.7 8.031 18.36 24.95 ... pressure (time, longitude, latitude) float64 1.374 1.142 1.388 0.9992 ...
  • 9. # numpy style ds.temperature[0, :, :] # pandas style ds.temperature.loc[:, -90, 50] # with dimension names ds.sel(time='2015-01-01') ds.sel(longitude=-90, latitude=50, method='nearest')
  • 10. # math (10 + ds) ** 0.5 ds.temperature + ds.pressure np.sin(ds.temperature) # aggregation ds.mean(dim='time') ds.max(dim=['latitude', 'longitude'])
  • 11. time time space space + = Result has the union of all dimension names
  • 12. year + = Result has the intersection of coordinate labels 2000 2001 2002 2003 2004 2005 2006 2007 2008 X X X X X
  • 13. # average by calendar month ds.groupby('time.month').mean('time') # resample to every 10 days ds.resample('10D', dim='time', how='max')
  • 14. # xray -> numpy ds.temperature.values # xray -> pandas ds.to_dataframe() # pandas -> xray xray.Dataset.from_dataframe(df)
  • 15. >>> ds = xray.open_mfdataset('/Users/shoyer/data/era-interim/*.nc') >>> ds <xray.Dataset> Dimensions: (latitude: 256, longitude: 512, time: 52596) Coordinates: * latitude (latitude) float32 89.4628 88.767 88.067 87.3661 86.6648 ... * longitude (longitude) float32 0.0 0.703125 1.40625 2.10938 2.8125 ... * time (time) datetime64[ns] 1979-01-01 1979-01-01T06:00:00 ... Data variables: t2m (time, latitude, longitude) float64 240.6 240.6 240.6 ... >>> ds.nbytes * (2 ** -30) 51.363675981760025
  • 16. ds_by_season = ds.groupby('time.season').mean('time') t2m_range = abs(ds_by_season.sel(season='JJA') - ds_by_season.sel(season='DJF')).t2m %time result = t2m_range.load() CPU times: user 2min 1s, sys: 49.5 s, total: 2min 51s Wall time: 38.6 s
  • 18.
  • 19. pandas: indexing, factorize NumPy: arrays netCDF4, h5py, SciPy: IO dask.array: out of core arrays