如何遍历每个列和行并附加到字符串并组成键值对

时间:2019-01-19 01:36:10

标签: python json pandas for-loop xlrd

how to loop through columns and rows in excel and add a string to columns 
and rows and make a key value pair?

#am getting columns and rows from excel by using xlrd in python?
host = '..................'
opinion = 'do'

columns = {"a1","a2","a3"}
rows = {"b1","b2","b3"}
mynums = 1234,4562,8521,6592

key = "k"
value = "V"

我如何循环显示列和行以获取类似以下格式的输出?

mine = {"k":"a1","V":"b1"} #post or put only works if it has this format
num = 1111 
mine = {"k":"a2","V":"b2"}
num = 2222
mine = {"k":"a3","V":"b3"}
num = 333

if opinion == 'd0'
    req2 = req.get(host=host)
    if mine.json() in req2
        req3 = req.put(host=host, json='how to loop here')
    else:
        request = req.post(host=host, mynum='how to loop here 'json=#how do i loop here )

我如何遍历每一列,每一行和mynums并执行request.put或request.post。如何在python中以这种格式制作json?请帮帮我

0 个答案:

没有答案