How to access BOLD timeseries data using atlas-Schaefer2018_desc-400Parcels with Python?

So basically I have this code

path = 'D:\\HCP\\102109\\MNINonLinear\\Results\\rfMRI_REST1_LR\\rfMRI_REST1_LR.nii.gz'
data = nib.load(path).get_fdata()
print(data.shape) -> (91, 109, 91, 1200)
parcel = nib.load('D:\\tpl-MNI152NLin6Asym_res-02_atlas-Schaefer2018_desc-400Parcels7Networks_dseg.nii.gz').get_fdata()
print(parcel.shape)-> (91, 109, 91)

So as you can see above I have data with 1200 volumes and I would like to see timeseries values of that data at any voxel using parcel

so I did something like this

print(data[parcel == 1,:]) -> results [[ 2434.07470703 2583.4675293 3325.28100586 ... 3812.09570312 4190.72998047 3546.79443359] [ 4231.00830078 5213.20703125 5124.62646484 ... 3983.50463867 4074.69018555 4423.80078125] [ 5913.71875 6116.45996094 5468.74169922 ... 3749.39257812 3225.42553711 4197.00244141] ... [12125.50097656 13127.78613281 13376.05761719 ... 12125.50097656 12349.25195312 11953.85546875] [10962.31835938 9743.57714844 8934.2578125 ... 9146.90234375 8937.43066406 9762.62011719] [12325.06738281 13152.96289062 12720.34082031 ... 13128.06445312 12788.81347656 12094.75097656]] So I think I was able to access the timeseries. But I don’t understand the 4D array numpy array logic part data[parcel == 1,:] how is this is working? Thanks it would be really helpful for my learning If anyone can point out some resources for neuroimaging analysis with python

I would recommend you to direct this question to https://neurostars.org/