Skip to content

BUG: fix tzaware dataframe transpose bug #26825

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

Merged
merged 23 commits into from
Jun 27, 2019
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c9130f8
BUG: fix tzaware dataframe transpose bug
jbrockmendel Jun 13, 2019
908465a
move TestTranspose
jbrockmendel Jun 13, 2019
2b89d35
actually save
jbrockmendel Jun 13, 2019
7bcdf16
Merge branch 'master' of https://github.com/pandas-dev/pandas into fr…
jbrockmendel Jun 13, 2019
f5759e6
troubleshoot windows fails
jbrockmendel Jun 13, 2019
3419983
Fix one more FIXME
jbrockmendel Jun 13, 2019
528015e
separate out _recast_datetimelike_Result
jbrockmendel Jun 13, 2019
508f8ae
Add GH references to tests
jbrockmendel Jun 13, 2019
c64d31f
add whatsnew
jbrockmendel Jun 13, 2019
6bd1a0a
annotation, typo fixup
jbrockmendel Jun 13, 2019
baacaaf
dont alter inplace
jbrockmendel Jun 13, 2019
c23edcc
Merge branch 'master' of https://github.com/pandas-dev/pandas into fr…
jbrockmendel Jun 16, 2019
b559753
Merge branch 'master' of https://github.com/pandas-dev/pandas into fr…
jbrockmendel Jun 17, 2019
e39370c
use maybe_convert_objects
jbrockmendel Jun 17, 2019
00b31e4
xfail tests where possible
jbrockmendel Jun 17, 2019
0a9a886
simplify list comprehension
jbrockmendel Jun 17, 2019
e88bc00
Merge branch 'master' of https://github.com/pandas-dev/pandas into fr…
jbrockmendel Jun 19, 2019
3c49874
Merge branch 'master' of https://github.com/pandas-dev/pandas into fr…
jbrockmendel Jun 24, 2019
5c38a76
single assignment
jbrockmendel Jun 24, 2019
657aa0c
fall through to create_block_manager_from_blocks
jbrockmendel Jun 24, 2019
be106cc
Merge branch 'master' of https://github.com/pandas-dev/pandas into fr…
jbrockmendel Jun 25, 2019
820c4e4
Fix assignment error
jbrockmendel Jun 25, 2019
8b2372e
Merge branch 'master' of https://github.com/pandas-dev/pandas into fr…
jbrockmendel Jun 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplify list comprehension
  • Loading branch information
jbrockmendel committed Jun 17, 2019
commit 0a9a886974c0b61a235d3d21bb61e84c899e200f
3 changes: 1 addition & 2 deletions pandas/core/internals/construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ def init_ndarray(values, index, columns, dtype=None, copy=False):
if values.ndim == 2 and values.shape[0] != 1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is much more messy, can we change something else to make this nicer?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. I'm looking into the other places where maybe_infer_to_datetimelike is used to see if some of this can go into that. We could separate this whole block into a dedicated function. But one way or another we need to bite the bullet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the inside of list loop should be in pandas.core.dtypes.cast, no? (obviously up until you make the blocks themselves)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to leave this for the next pass when I'm taking a more systematic look at maybe_infer_to_datetimelike

# transpose and separate blocks

dvals_list = [maybe_infer_to_datetimelike(values[n, :])
for n in range(len(values))]
dvals_list = [maybe_infer_to_datetimelike(row) for row in values]
for n in range(len(dvals_list)):
if isinstance(dvals_list[n], np.ndarray):
dvals_list[n] = dvals_list[n].reshape(1, -1)
Expand Down