Skip to content

Instantly share code, notes, and snippets.

@gchavez2
Created December 12, 2018 00:24
Show Gist options
  • Save gchavez2/3c007e4547ac88c23e5504fd779107ae to your computer and use it in GitHub Desktop.
Save gchavez2/3c007e4547ac88c23e5504fd779107ae to your computer and use it in GitHub Desktop.
Open csv file and just save a few columns
# module load python/3.6-anaconda-4.4
import csv
with open("susy_full_normed_train.csv","rt", encoding="utf8") as source:
rdr= csv.reader( source )
with open("susy_full_normed_train_low_features.csv","wt") as result:
wtr= csv.writer( result )
for r in rdr:
wtr.writerow( (r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7] ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment