Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas drop all columns except certain ones

df.drop(df.columns.difference(['a','b']), 1, inplace=True)
Comment

PREVIOUS NEXT
Code Example
Python :: pytorch check gpu 
Python :: auto clicker in python 
Python :: pytorch plt.imshow 
Python :: networkx remove nodes with degree 
Python :: sort python nested list according to a value 
Python :: how to create a list from csv python 
Python :: get_object_or_404 
Python :: pandas how to get last index 
Python :: pandas shuffle rows 
Python :: get longest shortest word in list python 
Python :: sum number in a list python using recursion 
Python :: install multiprocessing python3 
Python :: pygame get mouse position 
Python :: python current time 
Python :: images from opencv displayed in blue 
Python :: password generator python 
Python :: argparse 
Python :: discord.py make command admin only 
Python :: how to create a keylogger in python 
Python :: python filter array 
Python :: Counter to df pandas 
Python :: jupyter notebook dark theme 
Python :: find all nan columns pandas 
Python :: combination python 
Python :: remove whitespace around figure matplotlib 
Python :: how to take screenshots with selenium webdriver python 
Python :: python selenium scroll all down 
Python :: how to plot roc curve in python 
Python :: check corently installed epython version 
Python :: py get mouse coordinates 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =