issue_comments: 350818717
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/1773#issuecomment-350818717 | https://api.github.com/repos/pydata/xarray/issues/1773 | 350818717 | MDEyOklzc3VlQ29tbWVudDM1MDgxODcxNw== | 11997114 | 2017-12-11T18:46:12Z | 2017-12-11T18:46:12Z | NONE | @fmaussion Thank you, that's going to help with a lot of my problems for my computational work @shoyer I am looking at the docs for ``` import numpy as np import xarray as xr DomainSpaceTimeSize = 5 # using cartesian 4D SpaceTimeDensity = [100, 5] # 100 divisions in space 5 in time x_coord = np.linspace(-DomainSpaceTimeSize, +DomainSpaceTimeSize, SpaceTimeDensity[0]) y_coord = np.linspace(-DomainSpaceTimeSize, +DomainSpaceTimeSize, SpaceTimeDensity[0]) z_coord = np.linspace(-DomainSpaceTimeSize, +DomainSpaceTimeSize, SpaceTimeDensity[0]) t_coord = np.linspace(0, +DomainSpaceTimeSize, SpaceTimeDensity[1]) dx=xr.DataArray(x_coord, dims='x') dy=xr.DataArray(y_coord, dims='y') dz=xr.DataArray(z_coord, dims='z') dt=xr.DataArray(t_coord, dims='t') ds, =xr.broadcast(dx, dy)
ds, =xr.broadcast(ds, dz)
ds, _=xr.broadcast(ds, dt)
ds
``` from sympy import * init_printing() x, y, z, t=symbols('x, y, z, t') xDirVec=Matrix([1,0,0]) vector_func=cos(1x+2y+3z-4t)*xDirVec vector_func vector_funcN=lambdify((x, y, z, t), vector_func, dummify=False) data point testvector_funcN(1,1,1,1) target compersionvector_func_npRef=lambda x, y, z, t: np.array([np.cos(1x+2y+3z-4t), 0, 0]) point testvector_funcN(1,1,1,1) point test match test: passnp_SpaceResult=vector_func_npRef(np.meshgrid(x_coord, y_coord, z_coord, t_coord)).shape sp_SpaceResult=vector_funcN(np.meshgrid(x_coord, y_coord, z_coord, t_coord)).shape and as can be seen the two shapes dont match
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
280899335 |