如何在线性与线性图上仅在y轴上转动次刻度?
当我使用该函数打开次要刻度时,它们出现在x轴和y轴上.
作为一个例子,我的列表是:
[25.75443, 26.7803, 25.79099, 24.17642, 24.3526, 22.79056, 20.84866, 19.49222, 18.38086, 18.0358, 16.57819, 15.71255, 14.79059, 13.64154, 13.09409, 12.18347, 11.33447, 10.32184, 9.544922, 8.813385, 8.181152, 6.983734, 6.048035, 5.505096, 4.65799]
Run Code Online (Sandbox Code Playgroud)
我正在寻找最接近的值的索引11.5.我尝试了其他方法,如二进制搜索,bisect_left但它们不起作用.
我无法对此数组进行排序,因为该值的索引将用于类似的数组以获取该索引处的值.
当我使用我的脚本提交帖子请求时,我不对数据进行编码并准备帖子请求:
postheader.update({'Accept':'application/json; odata=verbose','Content-Type':'application/json; odata=verbose', 'X-RequestDigest':formdigestvalue, 'binaryStringRequestBody':'true'})
filetoupload = {'file':(filename, open(filename, 'rb'), 'application/vnd.openxmlformats-officedocument.presentationml.presentation')}
posturl = projectConfig.sharepointurl + "/_api/web/getfolderbyserverrelativeurl('Shared Documents/release_doc/"+project+"')/files/add(url='"+filename+"', overwrite='true')"
response = requests.post(posturl, headers=postheader, files=filetoupload, cookies=postcookies)
Run Code Online (Sandbox Code Playgroud)
我看了一下我使用我的脚本上传的文件,它还在内容中附加了以下标题:
--6ab0a06f1ddc432186194dd48355eac1
Content-Disposition: form-data; name="ZZZ Technology Guide.pptx"; filename="ZZZ Technology Guide.pptx"
Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation
<file content>
--6ab0a06f1ddc432186194dd48355eac1--
Run Code Online (Sandbox Code Playgroud)
但是,通过firefox上传的文件没有这些标头.我想我需要调用一个sharepoint函数(如果有一个REST API那样做)来处理文件上传之后,或者如果python请求中有一个方法可以处理这些文件中提到的这些文件:stackoverflow帖子
我有5个列表,我想将它们映射到分层字典.
让我说我有:
temp = [25, 25, 25, 25]
volt = [3.8,3.8,3.8,3.8]
chan = [1,1,6,6]
rate = [12,14,12,14]
power = [13.2,15.3,13.8,15.1]
Run Code Online (Sandbox Code Playgroud)
我想要的是我的字典是这样的:
{25:{3.8:{1:{12:13.2,14:15.3},6:{12:13.8,14:15.1}}}}
Run Code Online (Sandbox Code Playgroud)
基本上字典结构是:
{temp:{volt:{chan:{rate:power}}}}
Run Code Online (Sandbox Code Playgroud)
我尝试使用zip函数但在这种情况下它没有帮助,因为顶层列表中的重复值
python ×4
list ×2
dictionary ×1
http-headers ×1
mapping ×1
matplotlib ×1
search ×1
sharepoint ×1