看板 Python 關於我們 聯絡資訊
有個numpy array 第一列是文字 第二列是數字 numpy就會把數全部的據類型設為字串 請問有辦法 維持第一列的數據類型是字串的情況下 把第二列的數據類型改成數字嗎? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.251.209.62 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1505227904.A.4A2.html ※ 編輯: opengood5566 (111.251.209.62), 09/12/2017 23:01:21
Sunal: 型別不同不行 印象中numpy的array是用C實作的 09/12 23:16
me1996017: 搜尋 numpy structured array 應該能找到 09/13 00:29
steveyeh987: 用pandas dataframe可以做到 09/13 13:08
fischcheng: Pandas是你的好朋友。Series/DataFrame都可 09/13 21:15
numpy: pandas 的 apply 應該比我好用喔 09/29 01:34