Skip to content

Tag: numpy

Numpy Delete not deleting rows

I’ve been trying to write some code to delete rows from my 2d array according to the following criteria: every lone entry, so that no patient only has one entry (the mriindex ticks up by 1 for every entry of the same patient in the array) every entry above the 4th one. Should either of those criteria be…

Updating values within python column based on date

I have a dataset where I would like to replace and update values within a column when a data condition is met. Data Desired Doing Still researching, any suggestion is appreciated- Perhaps I need to convert quarters to datetime longdate and base the condition off of this column. Answer here is one way to do it…

All possible combinations of arrays in python

I have a problem finding all combinations of a 2D array. Let’s suggest I have an array as follwoing: Now I need to get all possible combninations such as I’ve managed to get it with numpy and meshgrids with single arrays: But with a 2D array I cant’t get it to work. This doesn’t give m…