如何在Excel中类似于vlookup查找某个值?以及如何使用 for 循环创建数据框?
我有两个数据框都有 2 列(2 个变量)。
我在想我可以在excel中使用类似于vlookup的东西吗? 也许我可以使用 for 循环创建一个新的数据集,并将商放入该数据集中,但我不知道具体该怎么做。
(我还需要将值放入数据集中,因此建议的帖子不能完全回答我的问题)
示例:
dataframe1
number amount
1 2
2 3
3 4
dataframe2
number amount
1 5
2 6
4 2
I have two dataframes both have 2 columns (2 variables).
I was thinking that I could use something similar to vlookup in excel?
And maybe I could create a new dataset using for loop and put the quotients in this dataset I don't know how exactly I could do that.
(I ALSO NEED TO PUT THE VALUES IN A DATASET so the suggested post does not answer my question completely)
example:
dataframe1
number amount
1 2
2 3
3 4
dataframe2
number amount
1 5
2 6
4 2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您将 Dataframe1 导入为
Dataframe1
,将 Dataframe2 导入为Dataframe2
,并且两者都是data.frame
。此时,您可以执行操作
并检查
结果
列是否是您要查找的内容。找到最高比率:
但是还有很多其他方法来记录这个值;这是最直接的。
Assuming that you imported Dataframe1 as
Dataframe1
, and Dataframe2 asDataframe2
, and both aredata.frame
.At this point you can perform your operation
and check if the column
result
is what you were looking for.To find the highest ratio:
But there are many other ways to record this value; this is the most straightforward.