Color KML Objects grouped - kml

I have a question regarding groups in KML.
I have a dataset, consisting of 50 objects. These objects have attributes,f.e severity. Is there any possibility to classify my KML-document based on these severity classes? (1/1.5/2) Or based on any of the other attributes?I already created folders manually, but the bigger the dataset gets the more work it is... I would also like to color the objects, based on the classification. Attached I will add my document. Maybe anyone has an idea how to approach this?
<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document id="root_doc">
<Schema name="Flood_2017_KML" id="Flood_2017_KML">
<SimpleField name="ID" type="int"></SimpleField>
<SimpleField name="GlideNumbe" type="string"></SimpleField>
<SimpleField name="Country" type="string"></SimpleField>
<SimpleField name="OtherCount" type="string"></SimpleField>
<SimpleField name="long" type="float"></SimpleField>
<SimpleField name="lat" type="float"></SimpleField>
<SimpleField name="Area" type="float"></SimpleField>
<SimpleField name="Began" type="string"></SimpleField>
<SimpleField name="Ended" type="string"></SimpleField>
<SimpleField name="Validation" type="string"></SimpleField>
<SimpleField name="Dead" type="int"></SimpleField>
<SimpleField name="Displaced" type="int"></SimpleField>
<SimpleField name="MainCause" type="string"></SimpleField>
<SimpleField name="Severity" type="float"></SimpleField>
</Schema>
<Folder><name>Flood_2017_KML</name>
<Folder id="Severity1_flood_2017">
<Style id="transGreyPoly">
<LineStyle>
<width>1</width>
<color>3c8C8C8C</color>
</LineStyle>
<PolyStyle>
<color>3c8C8C8C</color>
</PolyStyle>
</Style>
<Placemark>
<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
<SimpleData name="ID">4441</SimpleData>
<SimpleData name="Country">Peru</SimpleData>
<SimpleData name="long">-77.572950000000006</SimpleData>
<SimpleData name="lat">-5.250831000000000</SimpleData>
<SimpleData name="Area">288499.131403999985196</SimpleData>
<SimpleData name="Began">2017/02/01</SimpleData>
<SimpleData name="Ended">2017/02/07</SimpleData>
<SimpleData name="Validation">News</SimpleData>
<SimpleData name="Dead">1</SimpleData>
<SimpleData name="Displaced">12000</SimpleData>
<SimpleData name="MainCause">Heavy Rain</SimpleData>
<SimpleData name="Severity">1.000000000000000</SimpleData>
</SchemaData></ExtendedData>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>-78.859612,-8.472832 -80.740118,-5.695045 -79.255508,-4.505716 -77.57295,-2.721449 -74.405783,-2.02883 -74.702704,-5.995598 -78.859612,-8.472832</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
</Placemark>
<Placemark>
<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
<SimpleData name="ID">4457</SimpleData>
<SimpleData name="Country">Angola</SimpleData>
<SimpleData name="long">13.656325000000001</SimpleData>
<SimpleData name="lat">-8.717518999999999</SimpleData>
<SimpleData name="Area">24002.582783800000470</SimpleData>
<SimpleData name="Began">2017/03/21</SimpleData>
<SimpleData name="Ended">2017/04/08</SimpleData>
<SimpleData name="Validation">News</SimpleData>
<SimpleData name="Dead">11</SimpleData>
<SimpleData name="Displaced">344</SimpleData>
<SimpleData name="MainCause">Heavy Rain</SimpleData>
<SimpleData name="Severity">1.000000000000000</SimpleData>
</SchemaData></ExtendedData>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>14.126451,-9.709634 13.384147,-9.758848 12.988251,-8.965265 13.186199,-8.519087 13.087225,-7.77524 13.33466,-7.676191 14.324399,-8.321313 14.126451,-9.709634</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
</Placemark>y
<Placemark>
<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
<SimpleData name="ID">4460</SimpleData>
<SimpleData name="Country">Malawi</SimpleData>
<SimpleData name="long">33.871761999999997</SimpleData>
<SimpleData name="lat">-10.364181000000000</SimpleData>
<SimpleData name="Area">24405.783080000001064</SimpleData>
<SimpleData name="Began">2017/04/04</SimpleData>
<SimpleData name="Ended">2017/04/18</SimpleData>
<SimpleData name="Validation">News</SimpleData>
<SimpleData name="Dead">4</SimpleData>
<SimpleData name="Displaced">0</SimpleData>
<SimpleData name="MainCause">Heavy Rain</SimpleData>
<SimpleData name="Severity">1.000000000000000</SimpleData>
</SchemaData></ExtendedData>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>34.56458,-11.306672 33.228432,-11.206827 33.178945,-9.42169 34.119197,-9.521335 34.56458,-11.306672</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
</Placemark>
</Folder>
<Folder id="Severity1.5_flood_2017">
<Style id="transGreenPoly">
<LineStyle>
<width>1</width>
<color>507832F0</color>
</LineStyle>
<PolyStyle>
<color>507832F0</color>
</PolyStyle>
</Style>
<Placemark>
<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
<SimpleData name="ID">4433</SimpleData>
<SimpleData name="Country">Germany</SimpleData>
<SimpleData name="long">9.583276000000000</SimpleData>
<SimpleData name="lat">54.705274000000003</SimpleData>
<SimpleData name="Area">18991.845394600000873</SimpleData>
<SimpleData name="Began">2017/01/02</SimpleData>
<SimpleData name="Ended">2017/01/05</SimpleData>
<SimpleData name="Validation">News</SimpleData>
<SimpleData name="Dead">0</SimpleData>
<SimpleData name="Displaced">0</SimpleData>
<SimpleData name="MainCause">Winter Storm Axel</SimpleData>
<SimpleData name="Severity">1.500000000000000</SimpleData>
</SchemaData></ExtendedData>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>13.532608,54.306792 13.33466,53.662268 10.414927,53.415802 9.425187,54.457616 9.227239,55.251098 9.524161,55.994746 9.920057,55.944961 9.623135,54.953381 10.019031,54.407731 10.761336,54.109839 11.058258,53.911344 12.493381,54.009796 13.532608,54.306792</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
</Placemark>
</Folder>
<Folder id="Severity2_flood_2017">
<Style id="transPinkPoly">
<LineStyle>
<width>1</width>
<color>5014B45A</color>
</LineStyle>
<PolyStyle>
<color>5014B45A</color>
</PolyStyle>
</Style>
<Placemark>
<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
<SimpleData name="ID">4445</SimpleData>
<SimpleData name="Country">Chile</SimpleData>
<SimpleData name="long">-70.248874999999998</SimpleData>
<SimpleData name="lat">-30.939481000000001</SimpleData>
<SimpleData name="Area">183781.025771999993594</SimpleData>
<SimpleData name="Began">2017/02/24</SimpleData>
<SimpleData name="Ended">2017/03/03</SimpleData>
<SimpleData name="Validation">News</SimpleData>
<SimpleData name="Dead">3</SimpleData>
<SimpleData name="Displaced">1200</SimpleData>
<SimpleData name="MainCause">Heavy Rain</SimpleData>
<SimpleData name="Severity">2.000000000000000</SimpleData>
</SchemaData></ExtendedData>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>-70.644771,-35.947863 -72.030407,-36.04634 -71.733485,-32.277917 -71.634511,-29.699471 -70.842719,-26.129643 -69.852979,-25.832622 -68.467343,-26.626701 -69.358109,-28.411367 -69.951953,-30.4937 -70.347849,-31.782749 -70.248875,-33.072047 -70.644771,-35.947863</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
</Placemark>
<Placemark>
<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
<SimpleData name="ID">4450</SimpleData>
<SimpleData name="GlideNumbe">FL-2017-000018-PER</SimpleData>
<SimpleData name="Country">Peru</SimpleData>
<SimpleData name="long">-75.148087000000004</SimpleData>
<SimpleData name="lat">-11.004229000000000</SimpleData>
<SimpleData name="Area">810942.342724999994971</SimpleData>
<SimpleData name="Began">2017/02/01</SimpleData>
<SimpleData name="Ended">2017/03/22</SimpleData>
<SimpleData name="Validation">News</SimpleData>
<SimpleData name="Dead">78</SimpleData>
<SimpleData name="Displaced">70000</SimpleData>
<SimpleData name="MainCause">Heavy Rain</SimpleData>
<SimpleData name="Severity">2.000000000000000</SimpleData>
</SchemaData></ExtendedData>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>-70.050927,-17.99786 -73.020147,-16.70712 -76.08834,-14.226255 -78.56269,-9.960576 -80.938066,-4.504871 -77.770898,-4.010598 -75.989366,-6.094124 -73.119121,-9.566619 -69.358109,-14.626329 -70.050927,-17.99786</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
</Placemark>
<Placemark>
<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
<SimpleData name="ID">4456</SimpleData>
<SimpleData name="GlideNumbe">MS-2017-000033-COL</SimpleData>
<SimpleData name="Country">Colombia</SimpleData>
<SimpleData name="long">-76.113083000000003</SimpleData>
<SimpleData name="lat">2.187014000000000</SimpleData>
<SimpleData name="Area">28634.320610300001135</SimpleData>
<SimpleData name="Began">2017/04/01</SimpleData>
<SimpleData name="Ended">2017/04/08</SimpleData>
<SimpleData name="Validation">News</SimpleData>
<SimpleData name="Dead">314</SimpleData>
<SimpleData name="Displaced">0</SimpleData>
<SimpleData name="MainCause">Heavy Rain</SimpleData>
<SimpleData name="Severity">2.000000000000000</SimpleData>
</SchemaData></ExtendedData>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>-75.197574,1.640966 -76.286288,1.343995 -77.028593,1.939405 -76.880132,2.881474 -76.484236,3.030034 -75.741931,3.029661 -75.346035,2.434424 -75.197574,1.640966</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
</Placemark>
<Placemark>
<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
<SimpleData name="ID">4463</SimpleData>
<SimpleData name="GlideNumbe">FL-2017-000038-IRN</SimpleData>
<SimpleData name="Country">Iran</SimpleData>
<SimpleData name="long">46.169280000000001</SimpleData>
<SimpleData name="lat">37.704303000000003</SimpleData>
<SimpleData name="Area">40807.872714999997697</SimpleData>
<SimpleData name="Began">2017/04/15</SimpleData>
<SimpleData name="Ended">2017/04/21</SimpleData>
<SimpleData name="Validation">News</SimpleData>
<SimpleData name="Dead">42</SimpleData>
<SimpleData name="Displaced">0</SimpleData>
<SimpleData name="MainCause">Torrential Rain</SimpleData>
<SimpleData name="Severity">2.000000000000000</SimpleData>
</SchemaData></ExtendedData>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>47.530173,37.35593 46.738381,36.711703 45.204284,36.662888 44.808388,38.745718 46.639407,38.645625 47.530173,37.35593</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
</Placemark>
<Placemark>
<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
<SimpleData name="ID">4458</SimpleData>
<SimpleData name="GlideNumbe">TC-2017-000031-AUS</SimpleData>
<SimpleData name="Country">Australia</SimpleData>
<SimpleData name="OtherCount">New Zealand</SimpleData>
<SimpleData name="long">148.681590000000000</SimpleData>
<SimpleData name="lat">-21.974972999999999</SimpleData>
<SimpleData name="Area">258485.657990000006976</SimpleData>
<SimpleData name="Began">2017/03/28</SimpleData>
<SimpleData name="Ended">2017/04/08</SimpleData>
<SimpleData name="Validation">News</SimpleData>
<SimpleData name="Dead">6</SimpleData>
<SimpleData name="Displaced">20000</SimpleData>
<SimpleData name="MainCause">Tropical Cyclone Debbie</SimpleData>
<SimpleData name="Severity">2.000000000000000</SimpleData>
</SchemaData></ExtendedData>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>152.244654,-25.250018 149.077487,-25.645118 146.900059,-23.858911 145.118527,-20.089444 146.108267,-18.304829 147.295955,-19.693847 148.879539,-20.686372 149.671331,-22.471883 152.046707,-24.258189 152.244654,-25.250018</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
</Placemark>
<Placemark>
<ExtendedData><SchemaData schemaUrl="#Flood_2017_KML">
<SimpleData name="ID">4461</SimpleData>
<SimpleData name="Country">New Zealand</SimpleData>
<SimpleData name="long">176.790203999999989</SimpleData>
<SimpleData name="lat">-38.204245999999998</SimpleData>
<SimpleData name="Area">23530.760163599999942</SimpleData>
<SimpleData name="Began">2017/04/05</SimpleData>
<SimpleData name="Ended">2017/04/21</SimpleData>
<SimpleData name="Validation">News</SimpleData>
<SimpleData name="Dead">0</SimpleData>
<SimpleData name="Displaced">2200</SimpleData>
<SimpleData name="MainCause">Heavy Rain</SimpleData>
<SimpleData name="Severity">2.000000000000000</SimpleData>
</SchemaData></ExtendedData>
<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>178.027379,-37.758764 177.334561,-39.196423 175.800464,-38.898133 175.553029,-37.212069 175.948925,-37.4602 176.592256,-38.005975 177.384048,-38.055959 178.027379,-37.758764</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
</Placemark>
</Folder>
</Folder>
</Document></kml>

Assuming that you're working in Google Earth, unfortunately you'll need to try some different software for this. Google Earth does not have a way to do automatic grouping or classification on KML files. The only option it has for such things is in the import workflow, like when you're importing a shapefile in to Earth Pro and choose to use buckets for styling.
This is the kind of thing that you'll probably want to do in some GIS software with real analytical capabilities. QGIS is a great option that's free and open source, though it does have a bit of a learning curve. In there you'll be able to maintain your dataset, do grouping by attributes, and export to KML.

Related

Text in table cells not available in Word doc (python-docx)

I'm trying to extract the text from certain columns in tables saved in docx files, so I'm using the python-docx library to parse the documents but it's only returning the text from certain cells. I've used opc-diag to get the xml for the word doc, and I've pasted a snippet below. The only cells that I can read the text from are the ones containing numbers (so 1 in the snippet), but I can't see what's different about those cells in the XML. I know I might have to end up writing my own parser (can't use Word as the code will be hosted in an AWS service) but I feel like I'm missing something obvious. Has anybody come across anything like this before? I found some other stackoverflow answers mentioning <w:sdt> tags causing problems, but I don't have any of those.
The code I'm using to extract text from cells -
for table in raw_script.tables:
column_data = []
for column in table.columns:
for cell in column.cells:
if cell.text not in column_data:
column_data.append(cell.text)
print(column_data)
That prints ['', '1', '2', '3', '4', '5'], which isn't what I want!
The document.xml snippet, if it helps -
<w:body>
<w:tbl>
<w:tblPr>
<w:tblW w:w="10556" w:type="dxa"/>
<w:tblLayout w:type="fixed"/>
<w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/>
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="2978"/>
<w:gridCol w:w="794"/>
<w:gridCol w:w="1622"/>
<w:gridCol w:w="4084"/>
<w:gridCol w:w="1078"/>
</w:tblGrid>
<w:tr w:rsidR="00C409AE" w:rsidTr="00305E71">
<w:trPr>
<w:cantSplit/>
<w:trHeight w:val="2127"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="2978" w:type="dxa"/>
<w:tcBorders>
<w:top w:val="nil"/>
<w:left w:val="nil"/>
<w:bottom w:val="nil"/>
<w:right w:val="nil"/>
</w:tcBorders>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:hideMark/>
</w:tcPr>
<w:p w:rsidR="00C409AE" w:rsidRPr="00D01A3D" w:rsidRDefault="00CF5F0E" w:rsidP="00C409AE">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial"/>
<w:szCs w:val="20"/>
<w:u w:val="single"/>
<w:lang w:val="en-AU" w:eastAsia="en-AU"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial"/>
<w:szCs w:val="20"/>
<w:u w:val="single"/>
<w:lang w:val="en-AU" w:eastAsia="en-AU"/>
</w:rPr>
<w:t>
Sunset</w:t>
</w:r>
</w:p>
<w:p w:rsidR="00C409AE" w:rsidRPr="00D01A3D" w:rsidRDefault="00C409AE" w:rsidP="00C409AE">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial"/>
<w:szCs w:val="20"/>
<w:u w:val="single"/>
<w:lang w:val="en-AU" w:eastAsia="en-AU"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p w:rsidR="00C409AE" w:rsidRPr="00D01A3D" w:rsidRDefault="00C409AE" w:rsidP="00C409AE">
<w:pPr>
<w:rPr>
<w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial"/>
<w:b/>
<w:color w:val="000000"/>
<w:u w:val="single"/>
</w:rPr>
</w:pPr>
<w:r w:rsidRPr="00D01A3D">
<w:rPr>
<w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial"/>
<w:b/>
<w:color w:val="000000"/>
<w:u w:val="single"/>
</w:rPr>
<w:t>
Series Title: 10:00:02</w:t>
</w:r>
</w:p>
<w:p w:rsidR="00C409AE" w:rsidRPr="00D01A3D" w:rsidRDefault="00CF5F0E" w:rsidP="00C409AE">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial"/>
<w:b/>
<w:color w:val="000000"/>
<w:u w:val="single"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial"/>
<w:b/>
<w:color w:val="000000"/>
<w:u w:val="single"/>
</w:rPr>
<w:t>
Sample Script</w:t>
</w:r>
</w:p>
<w:p w:rsidR="00C409AE" w:rsidRPr="00305E71" w:rsidRDefault="00C409AE" w:rsidP="00C409AE">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial"/>
<w:szCs w:val="20"/>
<w:u w:val="single"/>
<w:lang w:val="en-AU" w:eastAsia="zh-TW"/>
</w:rPr>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="794" w:type="dxa"/>
<w:tcBorders>
<w:top w:val="nil"/>
<w:left w:val="nil"/>
<w:bottom w:val="nil"/>
<w:right w:val="nil"/>
</w:tcBorders>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:noWrap/>
<w:hideMark/>
</w:tcPr>
<w:p w:rsidR="00C409AE" w:rsidRDefault="00C409AE" w:rsidP="00C409AE">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:jc w:val="center"/>
<w:rPr>
<w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial"/>
<w:i/>
<w:iCs/>
<w:color w:val="000000"/>
<w:lang w:val="en-AU" w:eastAsia="en-AU"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial"/>
<w:i/>
<w:iCs/>
<w:color w:val="000000"/>
</w:rPr>
<w:t>
1</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1622" w:type="dxa"/>
<w:tcBorders>
<w:top w:val="nil"/>
<w:left w:val="nil"/>
<w:bottom w:val="nil"/>
<w:right w:val="nil"/>
</w:tcBorders>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:noWrap/>
<w:hideMark/>
</w:tcPr>
<w:p w:rsidR="00C409AE" w:rsidRDefault="00C409AE" w:rsidP="00C409AE">
<w:pPr>
<w:rPr>
<w:rFonts w:cs="Calibri"/>
<w:b/>
<w:bCs/>
<w:color w:val="000000"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Calibri"/>
<w:b/>
<w:bCs/>
<w:color w:val="000000"/>
</w:rPr>
<w:t>
SONG:</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="4084" w:type="dxa"/>
<w:tcBorders>
<w:top w:val="nil"/>
<w:left w:val="nil"/>
<w:bottom w:val="nil"/>
<w:right w:val="nil"/>
</w:tcBorders>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:hideMark/>
</w:tcPr>
<w:p w:rsidR="00C409AE" w:rsidRDefault="00CF5F0E" w:rsidP="00C409AE">
<w:pPr>
<w:rPr>
<w:rFonts w:cs="Calibri"/>
<w:color w:val="000000"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Calibri"/>
<w:color w:val="000000"/>
</w:rPr>
<w:t>
# Theme Music Lyrics</w:t>
</w:r>
</w:p>
<w:p w:rsidR="00CF5F0E" w:rsidRDefault="00CF5F0E" w:rsidP="00C409AE">
<w:pPr>
<w:rPr>
<w:rFonts w:cs="Calibri"/>
<w:color w:val="000000"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Calibri"/>
<w:color w:val="000000"/>
</w:rPr>
<w:t>
# Second Line Of Theme</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1078" w:type="dxa"/>
<w:tcBorders>
<w:top w:val="nil"/>
<w:left w:val="nil"/>
<w:bottom w:val="nil"/>
<w:right w:val="nil"/>
</w:tcBorders>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:noWrap/>
<w:hideMark/>
</w:tcPr>
<w:p w:rsidR="00C409AE" w:rsidRDefault="00C409AE" w:rsidP="00C409AE">
<w:pPr>
<w:jc w:val="right"/>
<w:rPr>
<w:rFonts w:cs="Calibri"/>
<w:color w:val="000000"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Calibri"/>
<w:color w:val="000000"/>
</w:rPr>
<w:t>
10:00:01</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
<w:tr w:rsidR="00C409AE" w:rsidTr="00305E71">
<w:trPr>
<w:cantSplit/>
<w:trHeight w:val="1512"/>
</w:trPr>
<w:tc>
<w:tcPr>
<w:tcW w:w="2978" w:type="dxa"/>
<w:tcBorders>
<w:top w:val="nil"/>
<w:left w:val="nil"/>
<w:bottom w:val="nil"/>
<w:right w:val="nil"/>
</w:tcBorders>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
<w:hideMark/>
</w:tcPr>

data_generator.flow_from_directory() function reads 4 images out of 20

I have 20 images in ./data/pets/test path but function return only 4 out of all.
data_generator = ImageDataGenerator(
validation_split=0.2,
rescale=1./255,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True)
data_generator = ImageDataGenerator(
validation_split=0.2,
rescale=1./255,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True)
Thank you.
According to this keras document
image_gen_1 = data_generator_1.flow_from_directory('input1_dir',
shuffle=False,
class_mode=None)
image_gen_2 = data_generator_2.flow_from_directory('input2_dir',
shuffle=False,
class_mode=None)

replace one element in multiple lists of list

I have multiple lists in the list and I want to replace "\xa0" in each list and I don't know how to do this my sample list looks like
[['0001/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'LSSZEC18033999', '\xa0'],
['0001/19-20', 'SAHAR AIR CARGO ACC (INBOM4)', '40693008366', '\xa0'],
['0002/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'APLU750808254', 'HTHC18032101'],
['0002/19-20', 'SAHAR AIR CARGO ACC (INBOM4)', '02037823030', '\xa0'],
['0003/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'LSSZEC18032365', '\xa0'],
['0003/19-20', 'NHAVA SHEVA SEA (INNSA1)', 'SHAE19030155', '\xa0'],
['0004/18-19', 'NHAVA SHEVA SEA (INNSA1)', '0258A33647', 'LLLNVS842311NVS'],
['0004/19-20', 'SAHAR AIR CARGO ACC (INBOM4)', '17602776476', '\xa0'],
['0005/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'APLU750808254', 'HTHC18032101'],
['0005/19-20', 'NHAVA SHEVA SEA (INNSA1)', 'SNKO02A190301057', '\xa0'],
['0006/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'SZWY18030109', '\xa0'],
['0006/19-20', 'SAHAR AIR CARGO ACC (INBOM4)', '40684842450', '3986'],
['0007/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'SRL18030520', '\xa0'],
['0007/19-20', 'NHAVA SHEVA SEA (INNSA1)', 'HDMUJPNS1768154', '\xa0'],
['0008/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'YSNBF18030315', '\xa0'],
['0008/19-20', 'MUMBAI', 'CTLQD19036504', '\xa0'], ['0009/18-19', 'NHAVA
SHEVA SEA (INNSA1)', 'SNKO02A180300433', '\xa0'], ['0009/19-20', 'SAHAR AIR
CARGO ACC (INBOM4)', '51404381786', 'X8867ANKF7X'], ['0010/18-19', 'NHAVA
SHEVA SEA (INNSA1)', 'SNKO02A180300587', '\xa0'], ['0010/19-20', 'NHAVA
SHEVA SEA (INNSA1)', 'SRL19030377', '\xa0']]
need help.
Try the below code, hope this helps.
data = [['0001/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'LSSZEC18033999', '\xa0'], ['0001/19-20', 'SAHAR AIR CARGO ACC (INBOM4)', '40693008366', '\xa0'], ['0002/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'APLU750808254', 'HTHC18032101'], ['0002/19-20', 'SAHAR AIR CARGO ACC (INBOM4)', '02037823030', '\xa0'], ['0003/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'LSSZEC18032365', '\xa0'], ['0003/19-20', 'NHAVA SHEVA SEA (INNSA1)', 'SHAE19030155', '\xa0'], ['0004/18-19', 'NHAVA SHEVA SEA (INNSA1)', '0258A33647', 'LLLNVS842311NVS'], ['0004/19-20', 'SAHAR AIR CARGO ACC (INBOM4)', '17602776476', '\xa0'], ['0005/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'APLU750808254', 'HTHC18032101'], ['0005/19-20', 'NHAVA SHEVA SEA (INNSA1)', 'SNKO02A190301057', '\xa0'], ['0006/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'SZWY18030109', '\xa0'], ['0006/19-20', 'SAHAR AIR CARGO ACC (INBOM4)', '40684842450', '3986'], ['0007/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'SRL18030520', '\xa0'], ['0007/19-20', 'NHAVA SHEVA SEA (INNSA1)', 'HDMUJPNS1768154', '\xa0'], ['0008/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'YSNBF18030315', '\xa0'], ['0008/19-20', 'MUMBAI', 'CTLQD19036504', '\xa0'], ['0009/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'SNKO02A180300433', '\xa0'], ['0009/19-20', 'SAHAR AIR CARGO ACC (INBOM4)', '51404381786', 'X8867ANKF7X'], ['0010/18-19', 'NHAVA SHEVA SEA (INNSA1)', 'SNKO02A180300587', '\xa0'], ['0010/19-20', 'NHAVA SHEVA SEA (INNSA1)', 'SRL19030377', '\xa0']]
newdata = [[sent.replace(u'\xa0', u' ') for sent in lst]for lst in data]
print(newdata)
in_list = [['123', '\xa0'], ['123', '\xa0'], ['123', '\xa0'], ['123', '\xa0']]
out_list = [[i.replace('\xa0', '') if i == '\xa0' else i for i in sub_list] for sub_list in in_list]

Neural Network stuck at training

Hello everyone I started training a network ana it got stuck, it did not finish the first epoch.
Here is the code I used:
top_model_weights_path = '/data/fc_model.h5'
img_width, img_height = 150, 150
-train_data_dir = '/data/train'
validation_data_dir = '/data/validation'
nb_train_samples = 2000
nb_validation_samples = 800
epochs = 50
batch_size = 16
model = applications.VGG16(weights='imagenet', include_top=False, input_shape=(150, 150, 3))
print('Model loaded.')
top_model = Sequential()
top_model.add(Flatten(input_shape=model.output_shape[1:]))
top_model.add(Dense(256, activation='relu'))
top_model.add(Dropout(0.5))
top_model.add(Dense(1, activation='sigmoid'))
top_model.load_weights(top_model_weights_path)
model = Model(inputs= model.input, outputs= top_model(model.output))
for layer in model.layers[:25]:
layer.trainable = False
model.compile(loss='binary_crossentropy',
optimizer=optimizers.SGD(lr=1e-4, momentum=0.9),
metrics=['accuracy'])
train_datagen = ImageDataGenerator(
rescale=1. / 255,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True)
test_datagen = ImageDataGenerator(rescale=1. / 255)
train_generator = train_datagen.flow_from_directory(
train_data_dir,
target_size=(img_height, img_width),
batch_size=batch_size,
class_mode='binary')
validation_generator = test_datagen.flow_from_directory(
validation_data_dir,
target_size=(img_height, img_width),
batch_size=batch_size,
class_mode='binary')
model.fit_generator(
train_generator,
samples_per_epoch=nb_train_samples,
epochs=epochs,
validation_data=validation_generator,
nb_val_samples=nb_validation_samples)
I am using Transfer Learning. I followed this tutorial online :
Tutorial
Please help thank you.

need help converting feet inches into inches in excel formulas

i'm using excel for my madden league and i want to convert the feet-inch designation into straight inches becuase it makes things alot easier for me . if you could help me design a formulat that would calculate those data points into inches so i can autosum and then average that would be amazing!
6'0''
6'2''
6'0''
6'3''
6'1''
6'0''
6'2''
6'1''
6'3''
6'1''
6'0''
6'4''
6'0''
6'1''
6'0''
6'3''
6'1''
6'1''
6'3''
6'2''
6'1''
6'1''
6'3''
6'5''
6'1''
6'2''
6'0''
6'1''
6'1''
6'1''
6'2''
6'2''
6'4''
6'1''
6'2''
6'1''
6'2''
6'2''
5'11''
6'1''
6'0''
6'2''
6'1''
6'0''
6'2''
6'1''
6'0''
6'1''
6'2''
6'1''
6'3''
6'0''
6'2''
6'2''
6'0''
6'2''
6'3''
6'1''
6'2''
6'1''
6'0''
6'1''
6'1''
6'3''
6'3''
5'11''
6'4''
6'1''
6'2''
6'3''
6'2''
6'2''
6'1''
6'1''
6'3''
6'3''
6'0''
6'0''
6'3''
6'0''
6'0''
6'5''
6'2''
6'2''
6'0''
6'1''
6'1''
6'4''
6'1''
6'1''
6'1''
6'2''
6'1''
6'4''
6'0''
6'3''
5'11''
6'1''
6'2''
6'1''
5'11''
6'1''
6'0''
6'0''
6'0''
6'3''
6'2''
6'1''
6'1''
6'1''
6'2''
6'2''
6'1''
6'6''
6'0''
6'2''
6'0''
6'3''
6'1''
6'1''
6'1''
6'0''
6'0''
6'0''
6'4''
6'4''
6'2''
6'3''
6'1''
6'1''
6'1''
6'1''
6'1''
6'3''
6'0''
6'1''
6'2''
6'0''
6'3''
6'0''
6'1''
6'3''
6'3''
6'3''
6'4''
6'2''
6'1''
6'2''
6'2''
5'11''
Try this
=LEFT(A1, FIND("'",A1)-1)*12 + MID(A1,FIND("'",A1)+1,LEN(A1)-FIND("'",A1)-2)

Resources