Skip to content

Instantly share code, notes, and snippets.

Stephan Hoyer shoyer

Block or report user

Report or block shoyer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View numpy-vindex.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View ufunc_method_mixin.py
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
View xarray CRS coord accessor
@xr.register_dataset_accessor('crs')
@xr.register_dataarray_accessor('crs')
def make_crs(xarray_obj):
return xarray_obj.coords['crs'].item()
In [24]: ds = xr.Dataset({'x': 1}, coords={'foo': 'bar', 'crs': 'hello, my lovely unwrapped object'})
In [25]: ds
Out[25]:
View strings.txt
HDF5 "strings.nc" {
GROUP "/" {
ATTRIBUTE "_NCProperties" {
DATATYPE H5T_STRING {
STRSIZE 8192;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_UTF8;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
View xarray multi-dimensional groupby demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shoyer
shoyer / xarray-tutorial-cleared.ipynb
Last active Mar 31, 2019
Xarray tutorial for Rossbypalooza
View xarray-tutorial-cleared.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View xarray-tutorial.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View numpy groupby.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View pandas IntervalIndex - docs.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shoyer
shoyer / faster.txt
Created Nov 18, 2015
xray pcolormesh profiling
View faster.txt
4099953 function calls (4093947 primitive calls) in 14.571 seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
89302 4.795 0.000 5.585 0.000 linref.py:14(__call__)
722 2.353 0.003 2.355 0.003 {cartopy.trace.project_linear}
89302 1.491 0.000 1.781 0.000 point.py:188(geos_point_from_py)
480 0.439 0.001 9.527 0.020 crs.py:329(_attach_lines_to_boundary)
288301 0.439 0.000 0.439 0.000 base.py:209(empty)
You can’t perform that action at this time.