在python 2.7中使用load_data加载数据

时间:2017-08-16 06:56:32

标签: python python-2.7

我正在使用python 2.7并尝试使用load_data

加载数据
import helper
import problem_unittests as tests

source_path = 'data/small_vocab_en'
target_path = 'data/small_vocab_fr'
source_text = helper.load_data(source_path)
target_text = helper.load_data(target_path)

哪个给了我

<ipython-input-1-ec5ca37388cc> in <module>()
      7 source_path = 'data/small_vocab_en'
      8 target_path = 'data/small_vocab_fr'
----> 9 source_text = helper.load_data(source_path)
     10 target_text = helper.load_data(target_path)

/home/ubuntu/Documents/karim/Data/bse/phase3/deep_learning/Seq2Seq-Language-Translation/helper.pyc in load_data(path)
     13     """
     14     input_file = os.path.join(path)
---> 15     with open(input_file, 'r', encoding='utf-8') as f:
     16         data = f.read()
     17 

TypeError: 'encoding' is an invalid keyword argument for this function

0 个答案:

没有答案