[問題] dataframe['']跟dataframe.的差異
在用pandas整理資料時發現
dataframe["column1"] = pd.to_numeric(dataframe["column1"])
dataframe["column2"] = pd.to_numeric(dataframe.column2 )
dataframe.column3 = pd.to_numeric(dataframe.column3 )
dataframe.column4 = pd.to_numeric(dataframe.["column4"])
四種方式都可以將資料型態轉成數值。
想請問各位大大 dataframe.column 跟 dataframe["column"]
在使用上有什麼不一樣的地方?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 59.102.195.196 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1608790516.A.FB8.html
→
12/24 15:12,
4年前
, 1F
12/24 15:12, 1F
→
12/24 15:12,
4年前
, 2F
12/24 15:12, 2F
→
12/24 15:12,
4年前
, 3F
12/24 15:12, 3F
→
12/24 15:12,
4年前
, 4F
12/24 15:12, 4F
→
12/24 15:13,
4年前
, 5F
12/24 15:13, 5F
→
12/24 21:03,
4年前
, 6F
12/24 21:03, 6F
→
01/20 15:32, , 7F
01/20 15:32, 7F
Python 近期熱門文章
PTT數位生活區 即時熱門文章