自己建立的csv檔案:

除了奇異的那一列
每一列都有四筆資料
要如何取出第四直欄?
如果直接取的話
因為奇異列的長度太短
會出現
IndexError: list index out of range
用try~except~語法
pass IndexError
#沒縮排會出現 ValueError: I/O operation on closed file.
#奇異列為一個空白跟一個空元素

推薦hahow線上學習python: https://igrape.net/30afN

例外觸發程序:

捕捉例外狀況:

推薦hahow線上學習python: https://igrape.net/30afN

![Python: 如何用numpy.ndarray的reshape 將3D array轉為2D array,再轉為pandas.DataFrame? arr.reshape( arr.shape[0] * arr.shape[1] , -1) Python: 如何用numpy.ndarray的reshape 將3D array轉為2D array,再轉為pandas.DataFrame? arr.reshape( arr.shape[0] * arr.shape[1] , -1)](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2023/03/20230320082325_85.png?quality=90&zoom=2&ssl=1&resize=350%2C233)

![Python: 如何求整個 pandas.DataFrame 中的最大值? pandas.DataFrame .max().max() ; 如何求最大值的index, columns? numpy.where(condition, [x, y, ]/) ; condition為一 bool_mask Python: 如何求整個 pandas.DataFrame 中的最大值? pandas.DataFrame .max().max() ; 如何求最大值的index, columns? numpy.where(condition, [x, y, ]/) ; condition為一 bool_mask](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2023/04/20230418154049_50.png?quality=90&zoom=2&ssl=1&resize=350%2C233)






近期留言