dplython
dplython copied to clipboard
Problem with Spread
I am trying to reshape this data, but I am getting this error

This bug is fixed with #83 .
The issue still persists, even with the addition of "convert_type=False"

it's not the convert_type that fixes the bug, it's one of the earlier commits in that pr (this one: https://github.com/dodger487/dplython/pull/83/commits/ced25d778db9d2bb689c60bcccf03e4125775554)
Hi, so I see where the issue is: if not all(new_spread_data.groupby([new_spread_data.index, key._name]).agg(' count').reset_index().value < 2): if not all(new_spread_data.groupby([new_spread_data.index, key._name]).agg(' count').reset_index()[values._name] < 2):
It seems as though the commit was not pushed to master. Or maybe I am using the wrong package version (0.0.7).
On Wed, Nov 21, 2018 at 9:18 AM bleearmstrong [email protected] wrote:
it's not the convert_type that fixes the bug, it's one of the earlier commits in that pr (this one: ced25d7 https://github.com/dodger487/dplython/commit/ced25d778db9d2bb689c60bcccf03e4125775554 )
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dodger487/dplython/issues/97#issuecomment-440548187, or mute the thread https://github.com/notifications/unsubscribe-auth/AjtvmJ2xI-wgUtVeVhlKPhnhGHDZ9QSHks5uxPA0gaJpZM4Yqob2 .
Hi,
Still waiting on response to this issue.
Kind regards,
Shelmith
On Wed, Nov 21, 2018 at 11:32 AM Shelmith Kariuki [email protected] wrote:
Hi, so I see where the issue is: if not all(new_spread_data.groupby([new_spread_data.index, key._name]).agg('count').reset_index().value < 2): if not all(new_spread_data.groupby([new_spread_data.index, key._name]).agg('count').reset_index()[values._name] < 2):
It seems as though the commit was not pushed to master. Or maybe I am using the wrong package version (0.0.7).
On Wed, Nov 21, 2018 at 9:18 AM bleearmstrong [email protected] wrote:
it's not the convert_type that fixes the bug, it's one of the earlier commits in that pr (this one: ced25d7 https://github.com/dodger487/dplython/commit/ced25d778db9d2bb689c60bcccf03e4125775554 )
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dodger487/dplython/issues/97#issuecomment-440548187, or mute the thread https://github.com/notifications/unsubscribe-auth/AjtvmJ2xI-wgUtVeVhlKPhnhGHDZ9QSHks5uxPA0gaJpZM4Yqob2 .
You are correct, the pr hasn't been merged. There's not much I can do about that, only @dodger487 can merge it.
Hi.
Okay, thanks a lot for feedback. Let us wait and hear from @dodger487 https://github.com/dodger487 .
On Thu, Nov 22, 2018 at 9:25 PM bleearmstrong [email protected] wrote:
You are correct, the pr hasn't been merged. There's not much I can do about that, only @dodger487 https://github.com/dodger487 can merge it.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dodger487/dplython/issues/97#issuecomment-441099882, or mute the thread https://github.com/notifications/unsubscribe-auth/AjtvmAgdtGNyENVFtpB9oUMfz8OirNXvks5uxuwOgaJpZM4Yqob2 .
Hi @dodger487,
I wanted to follow up on this. Last year, the only issue was spread, seems now we have an issue with both gather and spread.

I know this is an old issue, but I just hit both of the problems @Shelmith-Kariuki mentioned, so I thought I'd post my workarounds.
The spread issue can be worked around by using the spread function from tidypython instead of from dplython. They're designed to play nicely together, so I there's nothing else to do except import from there and use it as normal.
The gather issue is the result of outdated dplython pypi packages, which don't include gather. Installing from git should fix the gather issue:
pip install git+https://github.com/dodger487/dplython.git
It seems like dplython isn't being updated these days, but it would be really great if the spread function could be fixed! @dodger487