龍家俊教你 機器學習 day54 #Series的建立 # 導入pandas import pandas as pd pd.Series(data=None, index=None, dtype=None) 參數: data:傳入的數據,可以是ndarray、list等 index:索引,必須是唯一的,且與數據的長度相等。如果沒有傳入索引參數,則默認會自動創建一個從0-N的整數索引。 dtype:數據的類型 #通過已有數據創建 指定內容,默認索引 pd.Series(np.arange(5)) # 運行結果 0 0 1 1 2 2 3 3 4 4 dtype: int64
Log in to join in Reading is open to everyone. Replying needs an account.
No comments yet