小编Ani*_*mar的帖子

从未托管在 Google 云平台上的本地项目访问 Google 云 API

我想从本地 python 代码使用谷歌云自然语言 API。由于项目限制,我无法在 GCP 平台上运行我的代码。我有谷歌云帐户和积分来启用和使用 API。谷歌是否允许使用 API 在本地平台上运行。任何示例代码都会有所帮助。

python nlp google-cloud-platform

5
推荐指数
1
解决办法
217
查看次数

设计代码以生成特定模式

是否可以生成一列序列

1 1 2 1 2 3 1 2 3 4 .... so on 
Run Code Online (Sandbox Code Playgroud)

使用 dplyr

我尝试使用lag()功能,但不清楚

library(dplyr)
test <- as.data.frame(c(1:1000))
names(test) <- 'a'
# View(test)

test <- test %>% 
  mutate(
    c = # How to make this iterative to generate 1 2 2 3 3 3 4 4 4 4 .. so on
    b = ifelse(a %% c < a , a , NA)
  )

#tried to create 1 2 1 2 1 2 1 2 pattern …
Run Code Online (Sandbox Code Playgroud)

r vector dplyr

1
推荐指数
1
解决办法
74
查看次数

标签 统计

dplyr ×1

google-cloud-platform ×1

nlp ×1

python ×1

r ×1

vector ×1