arr = ['a','b']\r\nstr = ','.join(arr)<\/pre>\n\u6570\u5b57\u578blist\uff1a<\/p>\n
arr = [1,2,3]\r\n \r\nstr = ','.join(str(i) for i in b)<\/pre>\n\u4e8c\u7ef4list\u6570\u7ec4\u8f6cstring\uff1a<\/p>\n
\u5148\u8f6cnumpy\u6570\u7ec4\uff0c\u518d\u904d\u5386\u8f6cstr\uff1a<\/p>\n
import os\r\nimport numpy as np\r\n \r\ncentroids= [[1,2],[3,4]]\r\ncentroids=np.asarray(centroids)\r\nanchors = centroids.copy()\r\nwidths = anchors[:, 0]\r\nsorted_indices = np.argsort(widths)\r\n \r\nout_string=\"\"\r\nfor i in sorted_indices:\r\n out_string += str(int(anchors[i, 0] * 416)) + ',' + str(int(anchors[i, 1] * 416)) + ', '\r\n \r\nprint(\"str\", out_string[:-2])<\/pre>\n\u5ef6\u4f38\u9605\u8bfb\uff1apython\u4e2d\u7684\u5b57\u7b26\u6570\u5b57\u4e4b\u95f4\u7684\u8f6c\u6362\u51fd\u6570<\/strong><\/div>\nint(x [,base ])\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u5c06x\u8f6c\u6362\u4e3a\u4e00\u4e2a\u6574\u6570<\/p>\n
long(x [,base ])\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5c06x\u8f6c\u6362\u4e3a\u4e00\u4e2a\u957f\u6574\u6570<\/p>\n
float(x )\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5c06x\u8f6c\u6362\u5230\u4e00\u4e2a\u6d6e\u70b9\u6570<\/p>\n
complex(real [,imag ])\u00a0 \u00a0 \u00a0 \u521b\u5efa\u4e00\u4e2a\u590d\u6570<\/p>\n
str(x )\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5c06\u5bf9\u8c61 x \u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32<\/p>\n
repr(x )\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u5c06\u5bf9\u8c61 x \u8f6c\u6362\u4e3a\u8868\u8fbe\u5f0f\u5b57\u7b26\u4e32<\/p>\n
name = opt.name gpu_ […]<\/p>\n","protected":false},"author":362,"featured_media":220222,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-265276","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/265276","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/362"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=265276"}],"version-history":[{"count":18,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/265276\/revisions"}],"predecessor-version":[{"id":265295,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/265276\/revisions\/265295"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/220222"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=265276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=265276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=265276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}