Would it be possible to add a reshape style method to the Series object?
Currently if you need to flatten a series, for instance to perform factorization, there is no native way of reshaping the resulting series' spatial dimensions to that of the original series.
A workaround involves calling np.reshape with a concatenated tuple for the dimensions, for example,
However, if the series w is on Spark this appears to collect w before reshaping, and also returns an Numpy array which requires an extra step to make w a series again.
Would it be possible to add a
reshape
style method to the Series object?Currently if you need to flatten a series, for instance to perform factorization, there is no native way of reshaping the resulting series' spatial dimensions to that of the original series.
A workaround involves calling
np.reshape
with a concatenated tuple for the dimensions, for example,However, if the series
w
is on Spark this appears to collectw
before reshaping, and also returns an Numpy array which requires an extra step to makew
a series again.