Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
77 views
in Technique[技术] by (71.8m points)

python - DataFrame filtering


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It's already been asked, I was just searching the wrong terms.

The short answer is that chained relational operators such as 1 < a < 4 are expanded internally as (1 < a) and (a < 4). and and or cannot be overridden in Python -- see PEP335 and guido's post to the mailing list -- which means numpy can't use chained relational operators as masks. Thus, neither can Pandas.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...