Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

numpy delete column

import numpy as np

A = np.delete(A, 1, 0)  # delete second row of A
B = np.delete(B, 2, 0)  # delete third row of B
C = np.delete(C, 1, 1)  # delete second column of C
Comment

python numpy delete column

print(np.delete(a, 0, 0))
# [[ 4  5  6  7]
#  [ 8  9 10 11]]

print(np.delete(a, 2, 0))
# [[0 1 2 3]
#  [4 5 6 7]]

# print(np.delete(a, 3, 0))
# IndexError: index 3 is out of bounds for axis 0 with size 3
Comment

PREVIOUS NEXT
Code Example
Python :: create log in python 
Python :: python grid 
Python :: use loc for change values pandas 
Python :: rotate image python 
Python :: root mean square python 
Python :: pandas select rows by multiple conditions 
Python :: networkx draw graph with weight 
Python :: cut rows dataframe 
Python :: alpaca api python wrapper 
Python :: tensor vs numpy array 
Python :: pandas datetime from date month year columns 
Python :: python network programming 
Python :: python dataframe row count 
Python :: get page title by python bs4 
Python :: discord py fetch channel by id 
Python :: numpy 3 dimensional array 
Python :: find the highest 3 values in a dictionary. 
Python :: excel write in row 
Python :: pyqt menubar example 
Python :: initialise a 2d array python 
Python :: write binary file in python 
Python :: pandas get value not equal to 
Python :: try python import 
Python :: python how to make multiple box plots 
Python :: square root python 
Python :: how to write and read dictionary to a file in python 
Python :: python password with special characters 
Python :: Python code for checking if a number is a prime number 
Python :: suppress python vs try/except pass 
Python :: tuple plot python 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =