How to detect 'null' value in Nodebox?

Q's Avatar

Q

22 Mar, 2013 02:44 PM

Hello,
I imported data using import_csv and I am trying to catch null value. Is there any node supporting that?
Please let me know. Thank you.

  1. Support Staff 1 Posted by Frederik De Ble... on 22 Mar, 2013 05:03 PM

    Frederik De Bleser's Avatar

    Do you get null as an error message, or is the value empty?

  2. 2 Posted by Kyuha Shim on 22 Mar, 2013 05:08 PM

    Kyuha Shim's Avatar

    The value is empty. I was trying to change those items to either 0 or ' '. How do I do that? Please let me know. Thank you.

    Cheers,
    Q

    Mar 22, 2013 1:03 PM Frederik De Bleser <[email blocked]> 작성:

  3. Support Staff 3 Posted by Frederik De Ble... on 22 Mar, 2013 05:17 PM

    Frederik De Bleser's Avatar

    You could try using a "replace" node: connect a lookup node to import CSV and use a replace node to replace the empty string with "0". Afterwards, you might want to try converting everything to numbers again (using a number or integer node).

    If this approach does not work, we could consider adding a "default value on blank" option to the import CSV node.

  4. 4 Posted by Kyuha Shim on 22 Mar, 2013 07:41 PM

    Kyuha Shim's Avatar

    Thank you Frederik. It works :) Is it also possible to change strings to All Caps? Please let me know.
    Thank you.

    Cheers,
    Q

    Q / K y u h a S h i m

    Research Fellow / Data Visualization Specialist | Senseable City Lab, MIT
    Faculty | MFA Digital+Media, RISD

    MIT 9-209, 77 Massachusetts Ave,
    Cambridge, MA 02139 USA

    e [email blocked]<mailto:[email blocked]> || [email blocked]<mailto:[email blocked]>
    t +1.401.924.1002
    w http://kyuhashim.com

  5. Support Staff 5 Posted by lucasnijs on 23 Mar, 2013 08:32 PM

    lucasnijs's Avatar

    You can write your own python code to do that and then make your own node e.g.:

    def capitalize(str):
        s= str.upper()
        return s
    
    See how to make your own nodes: here
  6. Support Staff 6 Posted by Frederik De Ble... on 26 Mar, 2013 11:24 AM

    Frederik De Bleser's Avatar

    We should probably add a "change case" node that can switch between upper-, lower- and title case.

    I've created a GitHub Issue that tracks this.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

18 Nov, 2024 11:24 PM
18 Nov, 2024 09:01 PM
07 Nov, 2024 10:53 AM
02 Nov, 2024 11:22 AM
01 Nov, 2024 12:41 AM

 

01 Oct, 2024 07:59 AM
30 Sep, 2024 11:37 PM
30 Sep, 2024 11:11 AM
30 Sep, 2024 02:37 AM
28 Sep, 2024 10:33 AM
26 Sep, 2024 06:41 AM