Feral Cat

Building because fuck it.
Python

How to Delete a Column From a Pandas DataFrame

Need to delete a column from a Pandas DataFrame to make appending another easier? Did you bring in too much data? I just learned this quick trick and thought I’d pass it on.

Python

import pandas as pd
x=pd.DataFrame()
x['a']=[1,2,3,4]
x['b']=['a','b','c','d']
x.pop('b')
# Where b is the column name

Leave a Reply

Your email address will not be published. Required fields are marked *