change data format to include weight in binary file, add get weight to python