Since my previous question went unanswered, I'll try again more simply.
I have a program which makes a list containing row and column indexes:
a = [0, 0, 1, 1] # row
b = [0, 1, 0, 1] # column
This can also be formatted as lists of list:
a = [[0,0], [0,1], [1,0], [1,1]]
Dataframe:
Name 2544 2543 2542
0 DR01 13 16 23
1 DR02 15 27 12
2 DR03 16 18 13
3 DR04 17 92 56
Objective is to obtain the values from the dataframe mentioned based on indexes in list and create a new dataframe. I tried a for loop but that didn't work and was very slow.
What it should look like:
Name 2544
0 DR01 13
1 DR02 15
Update:
Here is what I have tried:
In[96]: df = importDialog.df.iloc[a,b]
In[96]: print(df)
Out[96]:
Name 2544 Name 2544
0 DR01 13 DR01 13
1 DR02 15 DR02 15
Also, when I try showing the complete dataset in a table:
MemoryError: Unable to allocate 9.06 GiB for an array with shape (34749, 34992) and data type object