I'm a bit confused... you want to create a raster by only maintaining the values in a range and you want to do this in Python. This question is also located in the Big Data space. What software (parts of the platform) do you have at your disposal?
Normally this is easily done manually using the Raster Calculator:
Raster Calculator—Help | ArcGIS Desktop (ArcMap) or
Raster Calculator—Help | ArcGIS Desktop (ArcGIS Pro)
You could simply specify a formula like:
Con(myRaster >= 1000, Con(myRaster <= 4000, myRaster))
In Python you can do something similar:
import arcpy
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")
dem = arcpy.Raster(r'C:\GeoNet\DEMrange\data.gdb\dem')
result = Con(dem >= 1000, Con(dem <= 4000, dem))
result.save(r'C:\GeoNet\DEMrange\data.gdb\result')
... but is it really necessary to do this in Python?