issues: 452729969
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
452729969 | MDU6SXNzdWU0NTI3Mjk5Njk= | 3000 | Slowness when cftime is installed | 3621629 | closed | 0 | 0 | 2019-06-05T21:40:42Z | 2019-06-10T04:48:44Z | 2019-06-10T04:48:44Z | CONTRIBUTOR | With ```python import numpy as np import pandas as pd import xarray as xr da = xr.DataArray(np.random.randn(5000, 500)) df = da.to_pandas() with pandas%time df_stacked = df.stack() Wall time: 48.3 ms%time df_unstacked = df_stacked.unstack() Wall time: 368 mswith xarray%time da_stacked = da.stack(stacked_dim=('dim_0', 'dim_1')) Wall time: 1.03 s%time da_unstacked = da_stacked.unstack('stacked_dim') Wall time: 78.2 ms``` prun points to The behaviour is also incorrect for empty indexes: ```python da[:0].stack(dim=['dim_0', 'dim_1']).dim.to_index() CFTimeIndex([], dtype='object', name='dim')``` |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3000/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |