dplython icon indicating copy to clipboard operation
dplython copied to clipboard

Problem with Spread

Open Shelmith-Kariuki opened this issue 7 years ago • 9 comments
trafficstars

I am trying to reshape this data, but I am getting this error screen shot 2018-11-20 at 11 47 06 screen shot 2018-11-20 at 11 47 19

Shelmith-Kariuki avatar Nov 20 '18 08:11 Shelmith-Kariuki

This bug is fixed with #83 .

bleearmstrong avatar Nov 20 '18 15:11 bleearmstrong

The issue still persists, even with the addition of "convert_type=False" screen shot 2018-11-21 at 09 13 13

Shelmith-Kariuki avatar Nov 21 '18 06:11 Shelmith-Kariuki

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)

bleearmstrong avatar Nov 21 '18 06:11 bleearmstrong

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 .

Shelmith-Kariuki avatar Nov 21 '18 08:11 Shelmith-Kariuki

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 .

Shelmith-Kariuki avatar Nov 22 '18 18:11 Shelmith-Kariuki

You are correct, the pr hasn't been merged. There's not much I can do about that, only @dodger487 can merge it.

bleearmstrong avatar Nov 22 '18 18:11 bleearmstrong

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 .

Shelmith-Kariuki avatar Nov 22 '18 18:11 Shelmith-Kariuki

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. screen shot 2019-02-08 at 12 34 19

Shelmith-Kariuki avatar Feb 08 '19 09:02 Shelmith-Kariuki

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

gtsherman avatar Aug 11 '20 21:08 gtsherman