Last active
October 24, 2017 14:45
-
-
Save AkdM/f30559fd59a64a807f76911f16f28c16 to your computer and use it in GitHub Desktop.
Remove Columns of a CSV with PANDAS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
input_file = "input.csv" | |
output_file = "output.csv" | |
sep = ";" | |
columns = ["column1", "column2", "anotherone"] | |
df = pd.DataFrame.from_csv(input_file, sep=sep) | |
df.drop(df[columns], axis=1, inplace=True) | |
df.to_csv(output_file, sep=sep) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment