我想在TabPy中创建一些代码,计算列中单词的频率,并删除Tableau中单词云的停止词
在Python中,我可以很容易地做到这一点:
other1_count = other1.answer.str.split(expand=True).stack().value_counts()
other1_count = other1_count.to_frame().reset_index()
other1_count.columns = ['Word', 'Count']
### Remove stopwords
other1_count['Word'] = other1_count['Word'].apply(lambda x: ' '.join([word for word in x.split() if word not in (stop)]))
other1_count['Word'].replace('', np.nan, inplace=True)
other1_count.dropna(subset=['Word'], inplace=True)
other1_count = other1_count[~other1_count.Word.str.contains("nan")]
但不太确定如何通过Tabby运行此功能。有谁熟悉Tabby,知道我怎么跑吗
提前谢谢
我认为熟悉与Tableau相关的Python的最好方法是Tableau社区上的这个(旧)线程:
https://community.tableau.com/s/news/a0A4T000002NznhUAC/tableau-integration-with-python-step-by-step?t=1614700410778
它一步一步地解释了初始设置以及如何通过Tableau计算字段“调用”Python
此外,您将在文章顶部找到对更新更多的Tabby GitHub存储库的引用: https://github.com/tableau/TabPy
我在R工作过一个项目,完成了一些非常类似的事情。这里有一个视频示例,展示了概念验证(没有音频)https://www.screencast.com/t/xa0yemiDPl
它本质上显示了使用Tableau交互检查选定国家的word cloud中葡萄酒描述的最终状态。主要组成部分是:
高层概述
表格计算字段-[R字+频率]:
Tableau单词值的计算字段:
表格频率值的计算字段:
如果您不熟悉Tableau,您可能希望与公司的Tableau分析师一起工作,他们将帮助您创建计算字段并配置Tableau以连接到Tabby
相关问题 更多 >
编程相关推荐