Pandas Series右连接的定义是什么?

时间:2018-05-31 16:17:13

标签: pandas time-series

鉴于两个系列s1s2,这两个代码片段是否等效?

s1, _ = s1.align(s2, join='right')

for k in s2.index:
    if not k in s1.index:
        s1[k] = np.nan

1 个答案:

答案 0 :(得分:1)

是的,2个代码是等效的,但如果s2大于s1,则与for循环的第二个选项相比第一个alignvar myIndex = 0; carousel(); function carousel() { var i; var x = document.getElementsByClassName("mySlides"); for (i = 0; i < x.length; i++) { x[i].style.display = "none"; } myIndex++; if (myIndex > x.length) {myIndex = 1} x[myIndex-1].style.display = "block"; setTimeout(carousel, 2000); // Change image every 2 seconds } }