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.
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