Commit 370f45f
BUG: Allow 'apply' to be used with non-numpy-dtype DataFrames
Addresses issue in #12244 in which a non-numpy-dtype for
DataFrame.values causes a `TypeError` to be thrown in the `reduce ==
True` case for `DataFrame.apply`. Resolved by first passing
`DataFrame.values` through `Series` initialization and taking its
`values` attribute, which is an `ndarray` and hence will have a valid
`dtype`. Note that the output of `apply` will still have the original
`dtype`.
Author: gfyoung <gfyoung17@gmail.com>
Closes #12284 from gfyoung/df_apply_tz_aware and squashes the following commits:
b18b74f [gfyoung] BUG: Allow apply to be used with non-numpy-dtype DataFrames1 parent 273bfb0 commit 370f45f
File tree
3 files changed
+34
-13
lines changed- doc/source/whatsnew
- pandas
- core
- tests/frame
3 files changed
+34
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
968 | 968 | | |
969 | 969 | | |
970 | 970 | | |
| 971 | + | |
971 | 972 | | |
| 973 | + | |
| 974 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4072 | 4072 | | |
4073 | 4073 | | |
4074 | 4074 | | |
4075 | | - | |
4076 | 4075 | | |
4077 | 4076 | | |
4078 | | - | |
4079 | | - | |
4080 | | - | |
4081 | | - | |
4082 | | - | |
| 4077 | + | |
| 4078 | + | |
| 4079 | + | |
| 4080 | + | |
| 4081 | + | |
| 4082 | + | |
| 4083 | + | |
| 4084 | + | |
4083 | 4085 | | |
4084 | | - | |
4085 | | - | |
4086 | | - | |
4087 | | - | |
4088 | | - | |
4089 | | - | |
4090 | | - | |
| 4086 | + | |
| 4087 | + | |
| 4088 | + | |
| 4089 | + | |
| 4090 | + | |
| 4091 | + | |
| 4092 | + | |
4091 | 4093 | | |
4092 | 4094 | | |
4093 | 4095 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
0 commit comments