Open madman-bob opened 6 years ago
Why would you need this? You'd be much better off just assigning those scalar values as individual columns - this seems rather hacky
I've got a DataFrame
and a collection of functions expecting Series
of various lengths, each returning a Series
, of potentially different length. I want to chunk the DataFrame
into various columns, apply
the appropriate functions, and then rejoin the DataFrame
.
For the most part this works fine, but it gets confused if the function expects a Series
of length 0.
That said, even without the above reason, it seems odd to me to treat the trivial case differently to all other cases. It's just bound to cause weird behaviour in edge cases.
The function is applied to every row, and is passed the columns.
Code Sample, a copy-pastable example if possible
Problem description
Applying with a function that doesn't depend on the columns of the input should always give the same output.
Expected Output
Output of
pd.show_versions()
Workaround
For anyone else experiencing this issue, the following can be used as a temporary workaround: