Skip to content

Commit 9932f81

Browse files
committed
Dictionary with array-like values is also matrix
1 parent 78066a4 commit 9932f81

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pygmt/helpers/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ def data_kind(
203203
(e.g., geopandas.GeoDataFrame or shapely.geometry)
204204
- ``"grid"``: a :class:`xarray.DataArray` object with dimensions not equal to 3
205205
- ``"image"``: a :class:`xarray.DataArray` object with 3 dimensions
206-
- ``"matrix"``: a :class:`pandas.DataFrame` object, a 2-D :class:`numpy.ndarray`
207-
or a sequence of sequences
206+
- ``"matrix"``: a :class:`pandas.DataFrame` object, a 2-D :class:`numpy.ndarray`,
207+
a dictionary with array-like values, or a sequence of sequences
208208
209209
In addition, the data can be given via a series of vectors (e.g., x/y/z). In this
210210
case, the ``data`` argument is ``None`` and the data kind is determined by the
@@ -252,6 +252,8 @@ def data_kind(
252252
'matrix'
253253
>>> data_kind(data=pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}))
254254
'matrix'
255+
>>> data_kind(data={"x": [1, 2], "y": [3, 4]})
256+
'matrix'
255257
>>> data_kind(data=[1, 2, 3])
256258
'matrix'
257259
"""

0 commit comments

Comments
 (0)