[Pandas-dev] Arithmetic Proposal

Joris Van den Bossche jorisvandenbossche at gmail.com
Thu Jun 13 13:28:59 EDT 2019


Op do 13 jun. 2019 om 19:19 schreef Brock Mendel <jbrockmendel at gmail.com>:

> > can you given your thoughts about the idea of having _only_ 1D Blocks?
> That could also solve a lot of the complexity of the internals (no 1D vs
> 2D) and have many of the advantages you mentioned in the first email, but I
> don't think you really answered that aspect.
>
> My read from the earlier email was that you were going to present a more
> detailed proposal for what this would look like.
>

A bit simplistic, but basically the same as your proposal but all 1D
instead of all 2D: all blocks are 1D (solves inconsistency), use custom EA
for the numpy based ones (the current PandasArray), ops are defined on the
arrays and Series/Index/DataFrame dispatch to them (which also ensures that
a column in a dataframe or a series will be handled consistently).
The rest of your Block simplications and Implementation strategy could (I
think) more or less be translated to the above as well.


> Going all-1D would solve the sometimes-1D-sometimes-2D problem, but I
> think it would cause real problems for transpose and reductions with axis=1
> (I've seen it argued that these are not common use cases).
>

For a DataFrame with only a single dtype, those operations will certainly
be a lot slower, but for heterogeneous maybe not that much.


> It also wouldn't change the fact that we need BlockManager or something
> like it to do alignment.  Getting array-like operations out of
> BlockManager/Block and into PandasArray could work with the all-1D idea.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pandas-dev/attachments/20190613/31de0dbe/attachment.html>


More information about the Pandas-dev mailing list