Home  >  Q&A  >  body text

python - numpy 的 loadtxt 函数读取汉字问题

PHPzPHPz2740 days ago1623

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-04-18 10:09:12

    Try this:

    tmp=np.loadtxt(open("test.txt", encoding='utf8'), dtype=np.str, delimiter=',')

    In addition, there is no need for a semicolon ";" after the Python statement

    reply
    0
  • Cancelreply