查找重复并分别翻转它们
df[0] = [0.0000000,0.0082707,0.0132000, 0.0255597, 0.0503554, 0.0751941, 0.1000570, 0.1498328, 0.1996558, 0.2495240, 0.2994312, 0.3993490, 0.4993711, 0.5994664, 0.6996058, 0.7997553, 0.8998927, 0.9499514, 1.0000000, 0.0000000, 0.006114 , 0.0062188, 0.0087532, 0.0138088, 0.0264052, 0.0515127, 0.0765762, 0.1016176, 0.1516652, 0.2016828, 0.2516733, 0.3016387, 0.4015163, 0.5013438, 0.6011363, 0.7008976, 0.8006328, 0.9003380, 0.9501740, 1.0000000]
df[1] = [0.00000,0.0233088,0.0298517,0.0425630,0.0603942,0.0739301,0.0850687,0.1023515,0.1149395,0.1149395,0.1230325,0.1230325,0.1272298,0.1272298,0.12253360,3333333533335333533333353335333335333353335333335333355 0445423、0.0207728、0.0098870、0.0000000、0.0000000,-.0208973,-.0210669,-.0210669, -.0247377, -.0307807, -.0416431, -.0548774, -.0637165, -.0703581, -.0801452, -.0869356, -.0910290, -.0926252, -.0905235, -.0834273, -. 0728351,-.0591463,-.0428603,-.0235778,-.0122883,0.0000000]
您可以使python代码在df [0] df [0]
和Lets中检测到一定数量的零数在此示例中说,如果它检测到三个或更多零在中间翻转阵列?因此,它看起来像df [0] = [0.00000,0.0082707,0.0132000,0.0255597,0.0503554,0.0751941,0.1000570,0.1498328,0.1498328 994664,0.6996058,0.7997553,0.8998927,0.9499514,1.0000000 , 1.0000000, 0.950174, 0.900338, 0.8006328, 0.7008976, 0.6011363, 0.5013438, 0.4015163, 0.3016387, 0.2516733, 0.2016828, 0.1516652, 0.1016176, 0.0765762, 0.0515127, 0.0264052, 0.0138088, 0.0087532 ,0.0062188, 0.006114, 0.0000000]
以及Flip df [1]
尊重df [0]
df[0] = [0.0000000,0.0082707,0.0132000, 0.0255597, 0.0503554, 0.0751941, 0.1000570, 0.1498328, 0.1996558, 0.2495240, 0.2994312, 0.3993490, 0.4993711, 0.5994664, 0.6996058, 0.7997553, 0.8998927, 0.9499514, 1.0000000, 0.0000000, 0.006114, 0.0062188, 0.0087532, 0.0138088, 0.0264052, 0.0515127, 0.0765762, 0.1016176, 0.1516652, 0.2016828, 0.2516733, 0.3016387, 0.4015163, 0.5013438, 0.6011363, 0.7008976, 0.8006328, 0.9003380, 0.9501740, 1.0000000]
df[1] = [0.0000000, 0.0233088, 0.0298517, 0.0425630, 0.0603942, 0.0739301, 0.0850687, 0.1023515, 0.1149395, 0.1230325, 0.1272298, 0.1253360, 0.1130538, 0.0934796, 0.0695104, 0.0445423, 0.0207728, 0.0098870, 0.0000000, 0.0000000, -.0208973, -.0210669, -.0247377, -.0307807, -.0416431, -.0548774, -.0637165, -.0703581, -.0801452, -.0869356, -.0910290, -.0926252, -.0905235, -.0834273, -.0728351, -.0591463, -.0428603, -.0235778, -.0122883, 0.0000000]
Can you make a python code detect a certain amount of zeros in df[0]
and lets say for this example if it detects three or more zeros flip the array in the middle? so it looks like df[0] = [0.0000000,0.0082707,0.0132000, 0.0255597, 0.0503554, 0.0751941, 0.1000570, 0.1498328, 0.1996558, 0.2495240, 0.2994312, 0.3993490, 0.4993711, 0.5994664, 0.6996058, 0.7997553, 0.8998927, 0.9499514, 1.0000000, 1.0000000, 0.950174, 0.900338, 0.8006328, 0.7008976, 0.6011363, 0.5013438, 0.4015163, 0.3016387, 0.2516733, 0.2016828, 0.1516652, 0.1016176, 0.0765762, 0.0515127, 0.0264052, 0.0138088, 0.0087532 ,0.0062188, 0.006114, 0.0000000]
and also flip df[1]
respect to df[0]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)