home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 383534360

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
383534360 MDU6SXNzdWUzODM1MzQzNjA= 2562 it seems that 'where' function has some problem 25431694 closed 0     2 2018-11-22T13:23:55Z 2018-11-22T16:33:51Z 2018-11-22T16:33:51Z NONE      

When I tried to use where condition to replace some values of array, I found something strange. For example: da = xr.DataArray(np.arange(24).reshape(2,3,4)) which produces an array , da Out[105]: <xarray.DataArray (dim_0: 2, dim_1: 3, dim_2: 4)> array([[[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]], [[12, 13, 14, 15], [16, 17, 18, 19], [20, 21, 22, 23]]]) Dimensions without coordinates: dim_0, dim_1, dim_2 If I want to replace the value of larger than 2 with 100, da.where(da>2,100) Out[106]: <xarray.DataArray (dim_0: 2, dim_1: 3, dim_2: 4)> array([[[100, 100, 100, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]], [[ 12, 13, 14, 15], [ 16, 17, 18, 19], [ 20, 21, 22, 23]]]) Dimensions without coordinates: dim_0, dim_1, dim_2 But it seems that the values of less than 2 was changed, and when I use another condition. da.where(da<2,100) Out[107]: <xarray.DataArray (dim_0: 2, dim_1: 3, dim_2: 4)> array([[[ 0, 1, 100, 100], [100, 100, 100, 100], [100, 100, 100, 100]], [[100, 100, 100, 100], [100, 100, 100, 100], [100, 100, 100, 100]]]) Dimensions without coordinates: dim_0, dim_1, dim_2 ``` xr.version Out[108]: '0.11.0'

``` I don't know whether I used the function in wrong way.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2562/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 2 rows from issue in issue_comments
Powered by Datasette · Queries took 0.747ms · About: xarray-datasette