Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Python List Gives an Error of Numpy Array?

$
0
0

I have a list which is 2 dimensional and has elements like ([0,1,2],[3,4,5]). Type of its elements is numpy.ndarray. I am trying to delete 2nd columns of each element. When I check its type, it returns list but it gives ValueError: cannot delete array elements error. I checked StackOverflow but haven't found a similar case. The code is below, any help is appreciated.

for row in trainSet:    del row[1]  

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>