Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python pandas in list

# Dataframe df column 'columnA' is any of the values 'value1', 'value2'
df[df['columnA'].isin(['value1', 'value2'])]['columnB']
# SQL equivalent:
SELECT columnB FROM df WHERE columnA IN ('value1', 'value2')
Comment

PREVIOUS NEXT
Code Example
Python :: pandas eliminar filas de un dataframe con una condicion 
Python :: python icon on task bar 
Python :: target ordinary encodiing) 
Python :: django update request.post 
Python :: selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: 
Python :: how to read hdf5 file in python 
Python :: check if the user is logged in django decorator 
Python :: url encoded path using python 
Python :: next() python 
Python :: pyautogui tab key 
Python :: python powerpoint 
Python :: rock paper scissors python 
Python :: Adding labels to histogram bars in matplotlib 
Python :: python extract values that have different values in a column 
Python :: all frequency offset in pandas 
Python :: what is a slug 
Python :: change a cell in pandas dataframe 
Python :: python turtle 
Python :: tuple comprehension python 
Python :: print for loop in same line python 
Python :: transform data frame in list 
Python :: python convert input into lowercase 
Python :: letters to numbers python 
Python :: how to add to the end of an array python 
Python :: convert .py to .ipynb file 
Python :: update nested dictionary python 
Python :: how to calculate fibonacci numbers in python 
Python :: tryexept in python 
Python :: readlines replace  
Python :: python raise exception 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =