Code Monkey home page Code Monkey logo

Comments (4)

kmdalton avatar kmdalton commented on June 12, 2024

On second thought, DataFrame.merge(how='outer') is supposed to sort keys lexicographically. So, that is hopefully not the culprit.

from reciprocalspaceship.

JBGreisman avatar JBGreisman commented on June 12, 2024

What version of pandas were you using here? I can reproduce this bug, but I do not have any stochasticity on my system (using the latest pandas v1.3.3).

from reciprocalspaceship.

JBGreisman avatar JBGreisman commented on June 12, 2024

In my mind, this is a bug in unstack_anomalous(), not stack_anomalous(). Your snippet can be made to work for me with the following change to the last line:

plus_labels  = ["F(+)", "loc(+)", "scale(+)"]
minus_labels = ["F(-)", "loc(-)", "scale(-)"]
unstacked.stack_anomalous(plus_labels=plus_labels, minus_labels=minus_labels)

to explicitly provide the columns in the expected order. As per the docstring, stack_anomalous() expects the corresponding column labels to be given in the same order. However, unstack_anomalous() should be made to always output the column labels in a way that would be compatible with stack_anomalous()

from reciprocalspaceship.

kmdalton avatar kmdalton commented on June 12, 2024

My pandas version:

[ins] In [1]: import pandas as pd    
                                     
[ins] In [2]: pd.__version__         
Out[2]: '1.3.2'                      

I agree that the bug is in unstack_anomalous. Sorry if that wasn't clear.

from reciprocalspaceship.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.