Home > other >  Python USES in question
Python USES in question

Time:09-19

Consult everybody, I am using pandas do excel table processing, when in use in some problems, such as:

In: t1=other. Iloc [0, "account")
In: t1
Out: 2015017733
In: t1 dype
Out: dtype (" int64 ")
In: other. (" account ")
Out: dtype (' int64)
In: 2015017733 in other
Out: False

Why use in queries fail? Even if is to use "2015017733" in other remains returns False, is what reason is this excuse me

CodePudding user response:

Print (other) [r]. "account" the isin ([2015017733]))

CodePudding user response:

Print ([2015017733] in other [r]. "accounts" tolist ())

CodePudding user response:

Not the list, although use the set is no problem, just don't know the reason why not

CodePudding user response:

refer to the second floor weixin_45903952 response:
print ([2015017733] in other [r]. "accounts" tolist ())
list or not, use the set can be, just don't know the reason why not

CodePudding user response:

reference 4 floor moyanyizu response:
Quote: refer to the second floor weixin_45903952 response:
print ([2015017733] in other [r]. "accounts" tolist ())
list or not, use the set can be, just don't know the reason why no


Is set into a tuple, tolist test is ok, I don't know why is wrong, you can put the test data in the form of code

CodePudding user response:

, the truth is that I have two dataframe, there is a column is the customer number, a large and a small, I am in big check which is in a small portion of the inside, and then corresponding processing, matching made with nested for loop check is ok, but time-consuming, I will change to use in, but oddly, can only be detected with small 5 before and after 5 records match, used in other look not to come out, but last night I had a notebook new copy code is implemented and the past again (I am using annacode), good strange, in the original code before change to go or not, don't know is what reason, anyway, thank you very, I also just learn python didn't take long, thank you for your help
  • Related