Skip to content

Getting same values in next() method #477

Answered by kernc
flexelem asked this question in Q&A
Discussion options

You must be logged in to vote

@flexelem As @AGG2017 said, if you modify:

        ...
        self.dir = self.I(lambda: self.spt_df.iloc[:, 1])

then self.dir[-1] in next() will work as you expect. Calling self.I() wraps the values into an indicator type that can be length-managed iteration-wise.


@AGG2017 Instead of self._broker._i I'd recommend i = len(self.data) or similar. This interface is public whereas _broker is not.

Replies: 5 comments 5 replies

Comment options

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

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@eervin123
Comment options

@kernc
Comment options

@flexelem
Comment options

Comment options

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

Answer selected by flexelem
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants