如何修复“美学必须长度为1或与数据相同(55161)”以有条件地对组织胺进行着色?

时间:2019-08-15 17:49:56

标签: r

我有一个像这样的数据集:

XML I need to read in (Expected Output):
<site host="192.168.212.4" name="http://192.168.212.4" port="80" ssl="false"><alerts><alertitem>\n  <pluginid>10021</pluginid>\n  <alert>X-Content-Type-Options header missing</alert>\n  <riskcode>1</riskcode>\n  <reliability>2</reliability>\n  <riskdesc>Low (Warning)</riskdesc>\n  <desc>The Anti-MIME-Sniffing header X-Content-Type-Options was not set to \'nosniff\'.\n\tThis allows older versions of Internet Explorer and Chrome to perform MIME-sniffing on the response body, potentially causing the response body to be interpreted and displayed as a content type other than the declared content type.\n\tCurrent (early 2014) and legacy versions of Firefox will use the declared content type (if one is set), rather than performing MIME-sniffing.\n\t</desc>\n  <uri>http://192.168.212.4/</uri>\n  <param/>\n  <attack/>\n  <otherinfo/>\n  <solution>Ensure that the application/web server sets the Content-Type header appropriately, and that it sets the X-Content-Type-Options header to \'nosniff\' for all web pages.\n\tIf possible, ensure that the end user uses a standards-compliant and modern web browser that does not perform MIME-sniffing at all, or that can be directed by the web application/web server to not perform MIME-sniffing.\n\t</solution>\n  <reference>\n\t</reference>\n</alertitem>


The Output when running request.FILES['file'].read() --- Current Output
b'----------------------------507481440966899800347275\r\nContent-Disposition: form-data; name=""; filename="sampleXML.xml"\r\nContent-Type: application/xml\r\n\r\n<site host="192.168.212.4" name="http://192.168.212.4" port="80" ssl="false"><alerts><alertitem>\n  <pluginid>10021</pluginid>\n  <alert>X-Content-Type-Options header missing</alert>\n  <riskcode>1</riskcode>\n  <reliability>2</reliability>\n  <riskdesc>Low (Warning)</riskdesc>\n  <desc>The Anti-MIME-Sniffing header X-Content-Type-Options was not set to \'nosniff\'.\n\tThis allows older versions of Internet Explorer and Chrome to perform MIME-sniffing on the response body, potentially causing the response body to be interpreted and displayed as a content type other than the declared content type.\n\tCurrent (early 2014) and legacy versions of Firefox will use the declared content type (if one is set), rather than performing MIME-sniffing.\n\t</desc>\n  <uri>http://192.168.212.4/</uri>\n  <param/>\n  <attack/>\n  <otherinfo/>\n  <solution>Ensure that the application/web server sets the Content-Type header appropriately, and that it sets the X-Content-Type-Options header to \'nosniff\' for all web pages.\n\tIf possible, ensure that the end user uses a standards-compliant and modern web browser that does not perform MIME-sniffing at all, or that can be directed by the web application/web server to not perform MIME-sniffing.\n\t</solution>\n  <reference>\n\t</reference>\n</alertitem>\n\n  \r\n----------------------------507481440966899800347275--\r\n'

我正在尝试创建一个按商店分组的直方图,并对每个单元格进行着色,无论它们是离群值还是非离群值。

但是我遇到了这个错误:

Store    ZScore
A        1
B        1
C        3
D        2
E        5
F        4

但是当我对填充和颜色使用ifelse语句时遇到错误。

Error: Aesthetics must be either length 1 or the same as the data (55161): colour, fill

最终结果应为每个商店着色并根据z分数对其进行概述。

0 个答案:

没有答案