Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

drop every other column pandas

#We would like to drop every other column
data = data.loc[:, np.arange(len(data.columns)) %2 == 0]
Comment

PREVIOUS NEXT
Code Example
Python :: how to update requirements.txt python 
Python :: plt .show 
Python :: fstring 
Python :: remove all odd row pandas 
Python :: pandas replace values based on condition 
Python :: changing plot background color in python 
Python :: python remove duplicate numbers 
Python :: nn.dropout 
Python :: how to rename rengeindex pandas 
Python :: plt.savefig specify dpi 
Python :: biggest of 3 numbers in python 
Python :: assign multiline string to variable in python 
Python :: sum of 2 numbers in python 
Python :: convert all items in list to string python 
Python :: python check if number is integer or float 
Python :: how to add an item to a dictionary in python 
Python :: data series to datetime 
Python :: how to select a file in python 
Python :: how to print answer 2 decimal places in python 3 
Python :: plot using matplotlib 
Python :: getting started with machine learning 
Python :: python code to print prime numbers 
Python :: seaborn boxplot 
Python :: pywhatkit send message 
Python :: filter query objects by date range in Django? 
Python :: how to invert plot axis python 
Python :: pyqt5 keypressevent 
Python :: python private 
Python :: cv2.namedWindow 
Python :: fromkeys in python 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =