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/2450#issuecomment-426421471,https://api.github.com/repos/pydata/xarray/issues/2450,426421471,MDEyOklzc3VlQ29tbWVudDQyNjQyMTQ3MQ==,41115380,2018-10-02T20:38:37Z,2018-10-02T20:38:37Z,NONE,"@spencerkclark yeah I was using a different platform, updated my xarray version and this works now, thanks!","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,365438396
https://github.com/pydata/xarray/issues/2450#issuecomment-426394309,https://api.github.com/repos/pydata/xarray/issues/2450,426394309,MDEyOklzc3VlQ29tbWVudDQyNjM5NDMwOQ==,41115380,2018-10-02T19:07:37Z,2018-10-02T19:07:37Z,NONE,"@spencerkclark
```python
Traceback (most recent call last):
File ""/var/spool/torque/mom_priv/jobs/63347.rdf-xcat.SC"", line 22, in
a = ml50_shear[0].where(ml50_shear[0] >= 11, other = 0)
NotImplementedError: The optional argument 'other' has not yet been implemented
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,365438396
https://github.com/pydata/xarray/issues/2450#issuecomment-426384000,https://api.github.com/repos/pydata/xarray/issues/2450,426384000,MDEyOklzc3VlQ29tbWVudDQyNjM4NDAwMA==,41115380,2018-10-02T18:35:32Z,2018-10-02T18:47:07Z,NONE,"@spencerkclark Oh you're right, I didn't think about that - it returns 4
Gonna try with just the first of the four","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,365438396
https://github.com/pydata/xarray/issues/2450#issuecomment-426377815,https://api.github.com/repos/pydata/xarray/issues/2450,426377815,MDEyOklzc3VlQ29tbWVudDQyNjM3NzgxNQ==,41115380,2018-10-02T18:17:10Z,2018-10-02T18:17:10Z,NONE,"@spencerkclark ah sorry I missed line 5 - I'm not looking to get the mean, I want to make sure the unusual values are still represented. That might be why mine went wrong, it generally only works when there's just one time. Anyway, here's what I tried:
```python
import xarray as xr
from function_codes import sfcwinds, complete_shear, winds
import os
pathway = #my pathway
os.chdir(pathway)
sfc_winds = sfcwinds(""sfc"")
ml50_winds = winds(""ml50"")
ml50_shear = complete_shear(sfc_winds, ml50_winds)
a = ml50_shear.where(ml50_shear >= 11, other = 0)
b = a.where(a == 0, other = 1)
pa = (b.sum('time') / b.sizes['time']) * 100
print(pa)
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,365438396
https://github.com/pydata/xarray/issues/2450#issuecomment-426371853,https://api.github.com/repos/pydata/xarray/issues/2450,426371853,MDEyOklzc3VlQ29tbWVudDQyNjM3MTg1Mw==,41115380,2018-10-02T17:59:47Z,2018-10-02T17:59:47Z,NONE,"@spencerkclark following your method:
```python
AttributeError: 'tuple' object has no attribute 'where'
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,365438396
https://github.com/pydata/xarray/issues/2450#issuecomment-426354773,https://api.github.com/repos/pydata/xarray/issues/2450,426354773,MDEyOklzc3VlQ29tbWVudDQyNjM1NDc3Mw==,41115380,2018-10-02T17:10:45Z,2018-10-02T17:10:45Z,NONE,"@spencerkclark Thanks a lot, I'll give it a try 👍 ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,365438396
https://github.com/pydata/xarray/issues/2450#issuecomment-426346137,https://api.github.com/repos/pydata/xarray/issues/2450,426346137,MDEyOklzc3VlQ29tbWVudDQyNjM0NjEzNw==,41115380,2018-10-02T16:45:17Z,2018-10-02T16:45:17Z,NONE,"@spencerkclark
```python
a = da.loc[date[0]] #the initial time, obviously this part doesn't work but this is the methodology
b = a.where(a >= threshold, other = 0) #keeps values that satisfy the threshold, sets the rest to 0
c = b.where(b == 0, other = 1) #sets all values that satisfy the threshold to 1
new_array = zero_array + c #zero_array is just an array of the same shape without time, set to 0
runs = runs + 1
```
Loops through this whole thing for every time (changing the loc to date[1], date[2], etc.), then:
```python
percentage = (new_array / runs) * 100
```
This is not my complete code but you should get the idea, as I said it works fine with only 1 time per day","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,365438396
https://github.com/pydata/xarray/issues/2450#issuecomment-426329598,https://api.github.com/repos/pydata/xarray/issues/2450,426329598,MDEyOklzc3VlQ29tbWVudDQyNjMyOTU5OA==,41115380,2018-10-02T15:58:21Z,2018-10-02T15:58:21Z,NONE,"@spencerkclark I'm creating a 2D array of the percentage of time each lon/lat coordinate exceeds a defined threshold. I did this fine before, but I was only using 1 time from each day","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,365438396
https://github.com/pydata/xarray/issues/2450#issuecomment-426316501,https://api.github.com/repos/pydata/xarray/issues/2450,426316501,MDEyOklzc3VlQ29tbWVudDQyNjMxNjUwMQ==,41115380,2018-10-02T15:24:21Z,2018-10-02T15:24:21Z,NONE,"@spencerkclark thanks for this, using '1979-01-01T00' works which is a relief. I am trying to use the method of date[number] because I have in excess of 4,000 times to go through. Is there a way to get it to work? I figured adding the %H would work, but obviously not!
Otherwise, at least I know I can revise my code to state the datetime explicitly. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,365438396