使用 JSON 将数据从 Python 导出到 Tableau?
Export data from Python into Tableau using JSON?
如何以 table 形式从 Python 向 Tableau 获取 400 万行和 28 列?
我假设(基于搜索)我应该使用 JSON 格式。这种格式可以处理大量数据并且速度足够快。
我制作了 12 行数据的子集并尝试让它工作。好消息是:它正在工作。坏消息:不是我想要的方式。
我的问题是,当我将其导入 Tableau 时,它看起来不像 table。我试过显示的方差 here.
这是 Python (pandas) 中的语句:
jsonfile = pbg.to_json("//vsv1f40/Pricing_Management$/Z-DataScience/01_Requests/Marketing/Campaign_Dashboard/Bronbestanden/pbg.json",orient='values')
也许我 select Tableau 中的模式太多(我 select 所有),但我认为我的问题在 Python。我需要使用另一个库而不是 Pandas 吗?还是我需要更改变量?
也欢迎其他方式。我不喜欢 JSON,但根据搜索结果,我认为这是最好的方法。
注意:我是 python 和 tableau 的新手 :) 我使用 python 3.5.2 并在 Jupyter 中工作。在 Tableau 中,我只有免费试用桌面版。
JSON 适用于某些类型的数据,但如果您的 DataFrame 是纯表格(没有 MultiIndexes、复杂对象等)并且包含简单数据类型(字符串、数字、浮点数),那么逗号分隔值 (CSV) 文本文件可能是最好使用的格式,因为它占用的空间最少 space。使用 to_csv()
method, and there are a number of customization options available. I'm not terribly familiar with Tableau, but according to their website CSV 文件是受支持的输入格式,可以轻松地将 DataFrame 另存为 CSV。
如何以 table 形式从 Python 向 Tableau 获取 400 万行和 28 列?
我假设(基于搜索)我应该使用 JSON 格式。这种格式可以处理大量数据并且速度足够快。
我制作了 12 行数据的子集并尝试让它工作。好消息是:它正在工作。坏消息:不是我想要的方式。
我的问题是,当我将其导入 Tableau 时,它看起来不像 table。我试过显示的方差 here.
这是 Python (pandas) 中的语句:
jsonfile = pbg.to_json("//vsv1f40/Pricing_Management$/Z-DataScience/01_Requests/Marketing/Campaign_Dashboard/Bronbestanden/pbg.json",orient='values')
也许我 select Tableau 中的模式太多(我 select 所有),但我认为我的问题在 Python。我需要使用另一个库而不是 Pandas 吗?还是我需要更改变量?
也欢迎其他方式。我不喜欢 JSON,但根据搜索结果,我认为这是最好的方法。
注意:我是 python 和 tableau 的新手 :) 我使用 python 3.5.2 并在 Jupyter 中工作。在 Tableau 中,我只有免费试用桌面版。
JSON 适用于某些类型的数据,但如果您的 DataFrame 是纯表格(没有 MultiIndexes、复杂对象等)并且包含简单数据类型(字符串、数字、浮点数),那么逗号分隔值 (CSV) 文本文件可能是最好使用的格式,因为它占用的空间最少 space。使用 to_csv()
method, and there are a number of customization options available. I'm not terribly familiar with Tableau, but according to their website CSV 文件是受支持的输入格式,可以轻松地将 DataFrame 另存为 CSV。