Skip to content

Tag: arrays

how to return None for empty array in python?

I have a dataframe with two columns. Column one contains an integer, the second column a list with multiple items, which also can be empty. I want to return a list with tuples, in which the first part of the tuple is the integer from col1, and the second part of the tuple is the integer from col2, listing in

Zipping two np.array into array

Im trying to combine following two np.arrays into a single array: The combination array must look like this [[i, pred, boxes],…]: I tried doing it this way, but it unfortunately didn’t work: Is there a way to do this? I tried other means but those tries were even worse. Answer Try hstack: