Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

drop unamed columns in pandas

df = df.loc[:, ~df.columns.str.contains('^Unnamed')]

In [162]: df
Out[162]:
   colA  ColB  colC  colD  colE  colF  colG
0    44    45    26    26    40    26    46
1    47    16    38    47    48    22    37
2    19    28    36    18    40    18    46
3    50    14    12    33    12    44    23
4    39    47    16    42    33    48    38
Comment

PREVIOUS NEXT
Code Example
Python :: how to clear a text file in python 
Python :: remove substring python 
Python :: dictionary in python does not support append operation 
Python :: get most recent file in directory python 
Python :: generate random integer matrix python 
Python :: how to merge dataframe with different keys 
Python :: take two numbers as inout in single line in python 
Python :: python rock paper scissor 
Python :: display current local time in readable format 
Python :: program to find even numbers in python 
Python :: django import timezone 
Python :: how to stop running code in python 
Python :: get index of element in numpy array python 
Python :: python version command notebook 
Python :: python list rotation 
Python :: python check if string is number 
Python :: how to clear command prompt python 
Python :: add numpy array to pandas dataframe 
Python :: leap year algorithm 
Python :: python create random matrix 
Python :: python global site packages 
Python :: python count lines in string 
Python :: backwards loop over list in python 
Python :: pyqt expressions 
Python :: static dirs django 
Python :: get index pandas condition 
Python :: random choice without replacement python 
Python :: pandas casting into integer 
Python :: plotly reverse y axis 
Python :: python writing to csv file 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =