home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 457799469

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/2714#issuecomment-457799469 https://api.github.com/repos/pydata/xarray/issues/2714 457799469 MDEyOklzc3VlQ29tbWVudDQ1Nzc5OTQ2OQ== 1217238 2019-01-26T04:02:09Z 2019-01-26T04:07:00Z MEMBER

OK, I think you're doing this right. You want an output with shape ['all_sites', 'dye_sites'] right?

My suggestion would be to add an explicit call to np.broadcast_arrays() at the start of your applied function. This will make the dimensions a little easier to understand. ```python def get_chebyshev_distances_xarray_ufunc(array, dye_array): array, dye_array = np.broadcast_arrays(array, dye_array) # array is a 3D numpy array with logical dimensions ['all_sites', 'dye_sites', 'dim_1'] # dye_array is a 3D numpy array with logical dimensions ['all_sites', 'dye_sites', 'dim_1']

# compute the distance matrix
# return a numpy array with logical dimensions ['all_sites', 'dye_sites']

``` (edit note: fixed dimensions)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  403378297
Powered by Datasette · Queries took 0.943ms · About: xarray-datasette