Python 如何使用pantab转换文件

Python 如何使用pantab转换文件,python,Python,我想使用python将“.csv”文件转换为“.hyper”文件。 所以我找到了潘塔布。但是当我运行它时,我得到了一条unicode错误消息 示例 import pandas as pd import pantab df = pd.DataFrame([ ["dog", 4], ["cat", 4], ], columns=["animal", "num_of_legs"]) pantab.frame_to_hyper(df, "example.hyper", table="

我想使用python将“.csv”文件转换为“.hyper”文件。 所以我找到了潘塔布。但是当我运行它时,我得到了一条unicode错误消息

示例

import pandas as pd
import pantab

df = pd.DataFrame([
    ["dog", 4],
    ["cat", 4],
], columns=["animal", "num_of_legs"])

pantab.frame_to_hyper(df, "example.hyper", table="animals")
错误代码

File "C:\python\lib\site-packages\tableauhyperapi\impl\dllutil.py", line 27, in char_p_to_string
    return ffi.string(p).decode()

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb4 in position 0: invalid start byte.

您能解释一下如何解决这个问题吗?

您好,看起来您指定了错误的表。制作
table=“animal”
。解决了吗?@Saddy,“animal”是列名在这种情况下,可能是由于您正在读取的文件中的无效字符。请参见Hello,注意,您不需要pantab来执行从
.csv
.hyper
的转换。您可以直接使用HyperAPI,如本例所示:回溯表明错误来自tableauhyperapi,因此我认为@jkammerer建议没有帮助。您安装了什么版本的Hyper API?您好,看起来您指定了错误的表。制作
table=“animal”
。解决了吗?@Saddy,“animal”是列名在这种情况下,可能是由于您正在读取的文件中的无效字符。请参见Hello,注意,您不需要pantab来执行从
.csv
.hyper
的转换。您可以直接使用HyperAPI,如本例所示:回溯表明错误来自tableauhyperapi,因此我认为@jkammerer建议没有帮助。您安装了什么版本的Hyper API?