Jump to content

PDG: python convert attributes based on names


ennioMa

Recommended Posts

Hello everyone, I have a pdg setup where I will have a large number of attributes piped in from a csv sheet, and I would like to convert every attribute ending with _prob to floats. My issue is I can't figure out how to iterate between all attributes to check their names and cast
I would like to do something resembling the following:

foreach attribute
    if "_prob" in attribute.name
         cant attribute to float

I've been looking for quite some time and can't find a solution, if anyone could nudge me in the right direction it would be great

Thanks in advance!

unknown.png

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...