1

I can use this code

df.loc[0 :4,"strength"]

and I get pandas series with no problem. but I can't use this code

upbound  = 0
lowbound = 4
df.loc[lowbound :upbound ,"strength"]

and I get empty pandas series. so why is that? is it some sort of python version problem? I have python 3.7.6 . will the

upbound  = 0
lowbound = 4
df.ix[lowbound :upbound ,"strength"]

work?

1 Answer 1

2

The reason here is the up and low opposite

lowbound = 0
upbound = 4
df.loc[lowbound :upbound ,"strength"]
Sign up to request clarification or add additional context in comments.

1 Comment

I would do that in 5 mins

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.