Skip to content
Discussion options

You must be logged in to vote

You can achieve this by customizing the Data.__inc__ method, see here:

class MyData(Data):
    def __inc__(self, key, value, *args, **kwargs):
        if key == 'node_type':
            return int(node_type.max()) + 1
        return super().__inc__(key, value, *args, **kwargs)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ZIKEYUAN
Comment options

Answer selected by ZIKEYUAN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants