Skip to content

Tag: python

List index out range while ready xyz file

This is the file that i am trying to read (it is a longer list with more bodies): It is supposed to be read as a label,mass, array of position, array of velocity. This done by: and to read this file I have used this loop: but i keep getting the error that the mass is list index out of

alternately flatten values of nested list

Is there a way to flatten values of a nested list but alternately? example: my expected output would be: Answer You can do it without numpy using iterators and keep track when the list stops growing: IF you have None values in your list, you need to choose another sentinel value.

Smallest Submatrix in python

It contains an R*C matrix with unique digits. I have to print the submatrix having minimum and maximum integer This is my code: I need a solution without a NumPy array. I found the max and min values and also their index. After that, I don’t know what to do. Answer You can iterate over matrix again and …

how to remove or hide rows in odoo tree if field is 0

I have a tree where in the “jumlah” column there is a value of 0, so I want the rows that in the “jumlah” column have 0 not to be displayed in the tree. here’s a picture of the tree I have. and here is the xml view of the table above edited: sorry I still don’t really under…

tf-idf for large number of documents (>100k)

So I’m doing tf-idf for very large corpus(100k documents) and it is giving me memory errors. Is there any implantation that can work well with such large number of documents? I want to make my own stopwords list. Also, it worked on 50k documents, what is the limit of number of documents I can use in thi…