Created
October 24, 2017 15:32
-
-
Save AkdM/56d3d7eab2e452ceb545438bd82f61fc to your computer and use it in GitHub Desktop.
Find columns on 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_find.csv" | |
sep = ";" | |
df = pd.DataFrame.from_csv(input_file, sep=sep) | |
column1 = df['one'] > 123 | |
column2 = df['two'] == "something" | |
df[column1 & column2].to_csv(output_file, sep=sep) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment