from osgeo import gdal
import glob
import os
input_path = 'F:prepinput'
output_path = 'F:prepconverted'
data_to_process = glob.glob(os.path.join(input_path, '*.tif'))
for data_path in data_to_process:
raster_dataset = gdal.Open(data_path, gdal.GA_ReadOnly)
raster = gdal.Translate(os.path.join(output_path, os.path.basename(data_path)), raster_dataset, outputType = gdal.GDT_Float32)