Lz's data: The most important properties of the data_array are printed out below: Even though the later has not been defined at this point, we can still pre-emptively include it, in case we want to modify it later. The None selection simply shows all the data, while the default refers to any selection made without explicitly naming it.
Jupyter notebook tutorial standford code#
Notice that in the above code cell, we specified the selection argument with a list containing two elements in this case, None and 'default'. a numpy array with extra metadata to make it fully self-describing. An xarray DataArray object can be seen as a labeled Nd array, i.e. Interally this is simply a numpy array, but we wrap it in an xarray DataArray object. If you run this notebook yourself (say on mybinder), you will see after executing the above cell, the selection will have ```` as its only value.įrom the specification of the axes and the selections, Vaex computes a 3d histogram, the first dimension being the selections. Note: If you see this notebook on readthedocs, you will see the selection coordinate already has ````, because cells below have already been executed and have updated this widget. The returned view is an ipywidget object, which becomes a visual element in the Jupyter notebook when displayed. Now that we have defined our two axes, we can create a (model) together with a (view).Ī convenient way to do this, is to use the widget accessor data_array method, which creates both, links them together and will return a view for us. An interactive xarray DataArray display ¶ We can also use observe to listen to any changes to our model.
This means that we can link all of its properties to an ipywidget and thus creating interactivity. Note that the Axis is a traitlets HasTrait object, similar to all ipywidget objects.
We want to build a 2 dimensinoal grid with the number counts in each bin.