gpt4 book ai didi

Python:如何将索引范围作为参数传递

转载 作者:行者123 更新时间:2023-11-28 21:20:49 25 4
gpt4 key购买 nike

我知道这是可能的,有没有其他方法可以传递类似 0:100 的内容?

a=range(1000)

ohlc.C.ix[a]

谢谢!

最佳答案

传递一个 slice 对象。

a = slice(0, 100)

关于Python:如何将索引范围作为参数传递,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22290268/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com