[英]Most efficient way to add additional rows up to a certain level that are NaN in value for Pandas Series
您可以使用.reindex()
並將range(1, 236)
的索引范圍擴展到range(1, 241)
,如下所示:
rr = rr.reindex(range(1, 241))
結果:
rr.tail(5)
236 NaN
237 NaN
238 NaN
239 NaN
240 NaN
dtype: float64
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.