Computational Biology log
Programming
Python
general
Statistics
Pandas
Machine Learning
NetworkX
igraph
Visualization
Bash & HPC
Latex
Git
Julia
R
Other info
Data science notes
Work
Readings
Research life
Projects
About me / CV
Search
the best through menu creator from swimbi.com. All Rights Reserved
News
New paper!
Friday, December 7, 2018
Select rows of pandas.DataFrame with complex criteria
Just to view the rows whose column A > x and B = y:
df[(df.A > x) & (df.B == y)]
However, in order to change the values in column A in rows that satisfy the condition,
df.loc[(df.A > 50) & (df.B == y), "A"] = x
Newer Post
Older Post
Home