Extracting specific columns in numpy array

前端 未结 9 1295
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 02:27

This is an easy question but say I have an MxN matrix. All I want to do is extract specific columns and store them in another numpy array but I get invalid syntax errors. He

9条回答
  •  心在旅途
    2020-11-28 02:33

    Assuming you want to get columns 1 and 9 with that code snippet, it should be:

    extractedData = data[:,[1,9]]
    

提交回复
热议问题