Last active
February 25, 2019 09:13
-
-
Save ochilab/e51f5c713fb190597834aa2873bc6cc2 to your computer and use it in GitHub Desktop.
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 codecs | |
import pandas as pd | |
recordFile="" | |
#UTF-8のCSVファイルを読む場合 | |
alldata = pd.read_csv(recordFile) | |
#Shift-JISのCSVファイルを読む場合 | |
with codecs.open(recordFile, "r", "Shift-JIS", "ignore") as file: | |
alldata = pd.read_table(file, delimiter=",") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment