Skip to content

Doc improvement for DataArray.assign_coords #3952

Closed
@EtienneCmb

Description

@EtienneCmb

Hi, first I wanted to say that xarray is a really fantastic library, it saves so many manipulations in my work.

I was looking for a way to add a coordinate to a DataArray and attribute it to a specific dimension. I found that the following syntax was exactly what I was looking for :

da.assign_coords(new_coordinate=('dim_to_use', values))

However, the documentation of the method was not referencing this syntax. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions