本文介绍了从数据框生成仓的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用python我创建了包含相似值的以下数据框架:
Using python I have created following data frame which contains similarity values:
c> / code>函数。到目前为止,我们一直在使用单个向量。但是,您希望将其用于一系列向量:数据帧的每一列。这就是应用的第二个参数。 1将该函数应用于所有行,2适用于所有列。将 cut 函数应用到数据框的每一列。在应用功能中的 cut 之后的所有内容只是 cut 的参数,我们在上面讨论过。Ok, the apply function. So far, we've been using cut on a single vector. But you want it used on a collection of vectors: each column of your data frame. That's what the second argument of apply does. 1 applies the function to all rows, 2 applies to all columns. Apply the cut function to each column of your data frame. Everything after cut in the apply function are just arguments to cut, which we discussed above.
希望有所帮助。
这篇关于从数据框生成仓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!