Jump to content
ennioMa

PDG: python convert attributes based on names

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

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×