Mateusz Soltysik Blog

Mateusz Soltysik Blog

On tech, software engineering, live & more.

30 Sep 2020

Remove Single Column From Huge CSV

We’re going to get rid of sure_name column.

Inlined:

python3 -c "import pandas as pd; df = pd.read_csv('IN_FILE.csv'); df.drop('sure_name', 1, inplace=True); df.to_csv('IN_FILE_WITHOUT_COLUMN.csv')"

Formatted:

import pandas as pd

df = pd.read_csv('IN_FILE.csv')
df.drop('sure_name', 1, inplace=True)
df.to_csv('IN_FILE_WITHOUT_COLUMN.csv')