I have a dataframe consisting of a few columns, among these are X, Y and Z coordinates.
(我有一个由几列组成的数据框,其中包括X,Y和Z坐标。)
Now there columns are all of equal length. (现在,所有列的长度相等。)
If you imagine a cylinder, what I am looking to do is to cut a part of the cylinder so that it gets shorter. (如果您想象一个圆柱体,我想做的就是切割圆柱体的一部分,使其变得更短。)
I have managed to figure out how to cut column Z with respect to the actual values in column Z: cutted_z = [i for i in df["Z"] if i >= 0 and i <= 1000]
(我设法弄清楚如何相对于Z列中的实际值切割Z列: cutted_z = [i for i in df["Z"] if i >= 0 and i <= 1000]
)
How can one cut XYZ equally with respect to the actual numerical values in Z?
(如何相对于Z中的实际数值平等地切割XYZ?)
The problem with my current solution is that it leaves the the length of the X and Y columns, as well as the rest of the columns in my dataframe, untouched, meaning X and Y now have more columns in Z.
(我当前解决方案的问题是,它不影响X和Y列的长度以及数据框中其余列的长度,这意味着X和Y现在在Z中具有更多列。)
ask by Zygos translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…