Boolean Indexing Question

Screen Link: https://app.dataquest.io/m/290/boolean-indexing-with-numpy/6/assigning-values-in-ndarrays

taxi_modified = taxi.copy()
taxi_modified[28214, 5] = 1
taxi_modified[:, 0] = 16
taxi_modified[1800:1802, 7] = taxi_modified[:,7].mean()

I was just wondering on the last line where we select rows 1800 and 1801 and reassign them so it’s the mean. When we do taxi_modified[:,7].mean() is that computing that on the entire data set? Or is it only doing it for those two rows and how?

No, it only calculates mean from the values returned by taxi_modified[:,7], i.e. from column 7 across all rows. Then it applies that calculated mean to the values in taxi_modified[1800:1802,7].
Hope it helps.