[英]how to convert a list of 2D Points in Python to a dataframe
2dpointList = [ Point(2020-01-31 23:00:00, 33.0), Point(2020-02-01 00:00:00, 33.0)]
如何將其轉換為索引為數據時間的數據幀
我想你可以使用 Python 字典:
point_list_2d = {
"2020-01-31 23:00:00": 33.0,
"2020-02-01 00:00:00": 33.0
}
那應該可以完成這項工作。
首先從您的點列表中創建一個字典,例如
x={ i[0]:i[1] for i in 2dpointList}
然后使用創建一個系列
pd.Series(x)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.