-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
OpenDAP loaded Dataset has lon/lats with type 'object'. #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is because coordinates are loaded as pandas.Index objects... which don't always faithfully preserve the type of the underlying object (see pandas-dev/pandas#6471). I believe serialization should still work though thanks to a work around I added for dtype=object. Do let me know if this is not the case. One solution to make this less awkward would be to wrap pandas.Index in something that keeps track of the dtype of the original arguments for use in mathematical expression. |
Indices also have an .inferred_type getter. unfortunately it doesn't seem In [13]: pandas.Index([1,2,3]).inferred_type In [14]: pandas.Index([1,2,3.5]).inferred_type In [15]: pandas.Index(["ab","cd"]).inferred_type In [16]: pandas.Index(["ab","cd",3]).inferred_type On Sun, Mar 2, 2014 at 10:14 PM, Stephan Hoyer [email protected]:
|
@shoyer You're right I can serialize the latitude object directly from that opendap url ... but after some manipulation I run into this:
Currently tracking down exactly whats going on here. |
When encoding cf variables check if dtype is np.datetime64. fixes akleeman/xray/issues/39
This allows us to simplify our internal model for XArray (it always cached internally as a base ndarray) and supports some previously tricky aspects involving pandas.Index objects. Noteably: 1. The dtype of arrays stored as pandas.Index objects can now be faithfully saved and restored. Doing math with XArray objects always yields objects with the right dtype, so `ds['latitude'] + 1` has dtype=float, not dtype=object. 2. It's no longer necessary to load index data into memory upon creating a new Dataset. Instead, the index data can be loaded on demand. 3. `var.data` is always an ndarray. `var.index` is always a pandas.Index. Related issues: #17, #39, #40.
I believe this was fixed by #54. |
* add initial draft of docs * add pages * made build work, but had to rollback docstring modification
This makes serialization fail.
The text was updated successfully, but these errors were encountered: