issues: 124664101
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
124664101 | MDU6SXNzdWUxMjQ2NjQxMDE= | 699 | BUG: Dataset.from_dataframe() losing dims? | 953992 | closed | 0 | 4 | 2016-01-03T18:42:52Z | 2016-01-04T02:05:33Z | 2016-01-04T02:05:33Z | MEMBER | ``` In [16]: df = DataFrame({'a': list('abc'), 'b': list(range(1, 4)), 'c': np.arange(3, 6).astype('u1'), 'd': np.arange(4.0, 7.0, dtype='float64'), 'e': [True, False, True], 'f': pd.Categorical(list('abc')), 'g': pd.date_range('20130101', periods=3), 'h': pd.date_range('20130101', periods=3, tz='US/Eastern')} ) In [17]: df.index.name = 'foo' In [18]: df.columns.name = 'bar' In [19]: df
Out[19]:
bar a b c d e f g h
foo In [20]: df.dtypes Out[20]: bar a object b int64 c uint8 d float64 e bool f category g datetime64[ns] h datetime64[ns, US/Eastern] dtype: object ``` ``` In [21]: import xray In [22]: xray.version Out[22]: '0.6.1' In [23]: xray.Data
xray.DataArray xray.Dataset In [24]: xray.Dat In [24]: xray.Dataset.from_dataframe(df) Out[24]: <xray.Dataset> Dimensions: (foo: 3) Coordinates: * foo (foo) int64 0 1 2 Data variables: a (foo) object 'a' 'b' 'c' b (foo) int64 1 2 3 c (foo) uint8 3 4 5 d (foo) float64 4.0 5.0 6.0 e (foo) bool True False True f (foo) category 'a' 'b' 'c' g (foo) datetime64[ns] 2013-01-01 2013-01-02 2013-01-03 h (foo) datetime64[ns] 2013-01-01T05:00:00 2013-01-02T05:00:00 ... ``` so [23] is a bit unsatisfying as it basically gloms together things. But [24] doesn't appear correct as its now 3 dims? what happened to bar? this in the context of |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/699/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |