I have a following panda dataframe. I need a code to split this dataframe into multiple dataframes using a 3X3 window.
import pandas as pd
d= {1: [5, 5, 5, 5, 4, 6,11,11], 3: [4, 5, 15, 25, 40, 10,25,33],6: [77, 47, 55, 59, 32, 5,9,22],
7: [15, 21, 40, 33, 30, 6,14,14],9: [10, 11, 12, 45, 14, 15,13,76],15: [3, 5, 32, 12, 11, 12,17,45],18: [3, 6, 23, 22, 21, 32,19,65],23: [6, 3, 5, 8, 10, 12,4,2]}
data_miss=pd.DataFrame(data=d)
data_miss.index=[1,3,4,8,10,25,32,40]
See the following picture as a schematic example:

As you can see from the above image, the rows and columns indexes are not in sequential numbers and I need to save both rows and column indexes with each extracted dataframe (see the extracted dataframes below the image). Also, the code should be able to consider the borders of the dataframe that the size of selected dataframes in row or col is smaller than 3 and the window should consider it and does not face an error.