Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/_static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@
.wy-nav-top {
background-color: #555;
}

table.colwidths-given {
table-layout: fixed;
width: 100%;
}
table.docutils td {
white-space: unset;
word-wrap: break-word;
}
47 changes: 47 additions & 0 deletions doc/howdoi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. currentmodule:: xarray

How do I ...
============

.. list-table::
:header-rows: 1
:widths: 40 60

* - How do I...
- Solution
* - add variables from other datasets to my dataset
- :py:meth:`Dataset.merge`
* - add a new dimension and/or coordinate
- :py:meth:`DataArray.expand_dims`, :py:meth:`Dataset.expand_dims`
* - add a new coordinate variable
- :py:meth:`DataArray.assign_coords`
* - change a data variable to a coordinate variables
- :py:meth:`Dataset.set_coords`
* - change the order of dimensions
- :py:meth:`DataArray.transpose`, :py:meth:`Dataset.transpose`
* - remove a variable from my object
- :py:meth:`Dataset.drop`, :py:meth:`DataArray.drop`
* - remove dimensions of length 1
- :py:meth:`DataArray.squeeze`, :py:meth:`Dataset.squeeze`
* - convert non-dimension coordinates to data variables or remove them
- :py:meth:`DataArray.reset_coords`, :py:meth:`Dataset.reset_coords`
* - rename a variable, dimension or coordinate
- :py:meth:`Dataset.rename`, :py:meth:`DataArray.rename`, :py:meth:`Dataset.rename_vars`, :py:meth:`Dataset.rename_dims`,
* - convert a DataArray to Dataset or vice versa
- :py:meth:`DataArray.to_dataset`, :py:meth:`Dataset.to_array`
* - extract the underlying array (e.g. numpy or Dask arrays)
- :py:attr:`DataArray.data`
* - convert to and extract the underlying numpy array
- :py:attr:`DataArray.values`
* - find out if my xarray object is wrapping a Dask Array
- :py:func:`dask.is_dask_collection`
* - know how much memory my object requires
- :py:attr:`DataArray.nbytes`, :py:attr:`Dataset.nbytes`
* - convert a possibly irregularly sampled timeseries to a regularly sampled timeseries
- :py:meth:`DataArray.resample`, :py:meth:`Dataset.resample`
* - apply a function on all data variables in a Dataset
- :py:meth:`Dataset.apply`
* - write xarray objects with complex values to a netCDF file
- :py:func:`Dataset.to_netcdf`, :py:func:`DataArray.to_netcdf` specifying ``engine="h5netcdf", invalid_netcdf=True``
* - make xarray objects look like other xarray objects
- :py:func:`~xarray.ones_like`, :py:func:`~xarray.zeros_like`, :py:func:`~xarray.full_like`, :py:func:`Dataset.reindex_like`, :py:meth:`Dataset.interpolate_like`, :py:meth:`Dataset.broadcast_like`, :py:func:`DataArray.reindex_like`, :py:meth:`DataArray.interpolate_like`, :py:meth:`DataArray.broadcast_like`
2 changes: 2 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Documentation
**Help & reference**

* :doc:`whats-new`
* :doc:`howdoi`
* :doc:`api`
* :doc:`internals`
* :doc:`roadmap`
Expand All @@ -96,6 +97,7 @@ Documentation
:caption: Help & reference

whats-new
howdoi
api
internals
roadmap
Expand Down