Last active
May 31, 2016 11:25
-
-
Save kurozumi/057a670b477b29968cb88e87d1eae000 to your computer and use it in GitHub Desktop.
【Python】PythonでCSVファイルをソートする方法
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 csv, operator | |
with open("file.csv", "r") as f: | |
reader = csv.reader(f) | |
# operator.itemgetter(0)で一列目をソート | |
print sorted(reader, key=operator.itemgetter(0)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment