Code Monkey home page Code Monkey logo

Comments (5)

sweverett avatar sweverett commented on September 15, 2024

There may be NaN's or empty values in the SNR column. I'd print out the column to inspect it.

from clustr.

paigemkelly avatar paigemkelly commented on September 15, 2024

It does, I have found a few. Jose suggested removing the NaNs before making the flag cuts, but I am having some issues getting that to work. This is the error I'm getting for that:
IndexError: boolean index did not match indexed array along dimension 0; dimension is 205 but corresponding boolean dimension is 1092
I'm trying to figure out if I should try to change the NaNs in the catalog, or keep trying to find a way to remove them before the SNR cut.

from clustr.

sweverett avatar sweverett commented on September 15, 2024

Ok I just checked - the NaN check was only in place for get_data(): https://github.com/sweverett/CluStR/blob/master/clustr.py#L267

The flag cuts don't currently have this check. So if you are creating a "mask" which contains 1 for things that you want to cut, then it would look something like this:

mask |= (flag_condition) | (np.isnan(catalog[flag_column]))

What this does is take the existing mask and add new mask values for this specific flag (mask |= corresponds to mask = mask | ...) . Instead of just having the flag condition that you usually have, you also look to see if there are NaN's for flag values. This says a cluster should be flagged if the condition is met or if there is a NaN.

from clustr.

paigemkelly avatar paigemkelly commented on September 15, 2024

I don't make the mask until after the greater than statement, so I get the same error when I put that in. I believe it is working and just ignoring the NaNs. Should I just suppress the error and move on for now? or try to figure it out?

from clustr.

jjobel avatar jjobel commented on September 15, 2024

Works for version 2c3f335 clustr.py.

The issue came from using NaNs with comparison operators.

NaNs are dealt with by equating them to dummy variables then comparing them to cut_off_value.

from clustr.

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.