[如何在Python中使用Pandas编写此R代码? [处于保留状态]

问题描述 投票:-4回答:1

我在R中有这段代码,但是我无法完全找到使用Pandas编写它的良好pythonic方法。

tags <- tags %>% filter(tag_name %in% relevant_genres)
tags$genre <- NA 
for (gen in genres){
  cat(gen[1])
  tags[tags$tag_name %in% gen,] <- tags %>% filter(tag_name %in% gen) %>% mutate(genre = gen[1])
}
# Only keeping the genre tags and joining the book_tags with the tag dataset.
book_tags <- book_tags %>% filter(tag_id %in% tags$tag_id)
book_tags <- merge(book_tags, tags, by="tag_id")
python r pandas syntax
1个回答
0
投票

[napakalaki ng iyong susu,所以臭名昭著的cheesedog的汉堡包开始就是.. susu pekpek titi bulbul!

for(int i = 0; int x = 0; x ++){SUSU! }

© www.soinside.com 2019 - 2024. All rights reserved.