conversion of dictionary to json to be sent to requests.post
To build your data use sth like:
import copy, json

def make_objects(ref_obj, df):
    objects = []
    for i in range(len(df[df.columns[0]].values)):
        cobj = copy.deepcopy(ref_obj)
        cobj['data_sample'] = {}
        for col in df:
            cobj['data_sample'][col] = int(df[col].values[i]) if df[col].dtype == np.int64 else (float(df[col].values[i]) if df[col].dtype == np.float64 else df[col].values[i])
        objects.append(cobj)
    return objects
    
df = pd.DataFrame({'sub1':[10,20,30,40],'sub2':[5,10,15,20],'sub3':[1,2,3,4]})
objects = make_objects({'name':&quot;abc&quot;,'id':&quot;AB10&quot;,'address':&quot;some_address&quot;}, df)
# in case you want to json-encode the returned objects
json_output = json.dumps(objects)