FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated use `arr[tuple(seq)]` instead of `arr[seq]`

前端 未结 3 1817
暖寄归人
暖寄归人 2020-12-15 17:06

I would like not to use the non-tuple sequence for multidimensional indexing so that the script will support future release of Python when this changes.

Below is the

3条回答
  •  情话喂你
    2020-12-15 17:35

    I would have tested this before posting (well, I did test it for areas where I was having the same problem), but I suspect that this will help you. Using your first line where you call a plot above, use tuple type casting as I've shown and do the same to your other lines calling plot.

    p1, = host.plot(tuple(data["column_1"]), 
                    tuple(data["column_2"]), 
                    "b-", label="column_2")
    

    When I studied numpy methods of indexing, the warning made a little more sense. However, I don't really understand why things need to go this way.

提交回复
热议问题