【发布时间】:2015-11-05 17:10:17
【问题描述】:
我正在尝试在 pandas 中运行以下 SQL 语句(显然是在 Python 代码中),但无处可去:
select year, contraction, indiv_count, total_words from dataframe
where contraction in ("i'm","we're","we've","it's","they're")
其中contractions 是char,year、indiv_count 和total_words 是int。
我对熊猫不太熟悉。如何在 Python 中创建类似的语句?
【问题讨论】:
-
您阅读过文档吗? Comparison with SQL
-
谢谢。这两个答案都是我需要的。我只是没有在搜索中找到它们。
标签: python sql pandas dataframe