def test_parse_add_info(self): s = "'SCH1'" v = utils.parse_add_info(s) self.assertEqual(v, "1) spoor schelpmateriaal <1% ") s = "'DO TOL RO'" v = utils.parse_add_info(s) self.assertEqual(v, "1) dark olive-red ") s = "'BIO'" v = utils.parse_add_info(s) self.assertEqual(v, "1) bioturbatie ") s = "'KEL DR'" v = utils.parse_add_info(s) self.assertEqual(v, "1) keileem Formatie van Drente ")
def test_parse_add_info(self): s = "'SCH1'" v = utils.parse_add_info(s) self.assertEqual(v, "spoor schelpmateriaal <1%|") s = "'DO TOL RO'" v = utils.parse_add_info(s) self.assertEqual(v, "dark olive-red|") s = "'BIO'" v = utils.parse_add_info(s) self.assertEqual(v, "bioturbatie|") s = "'KEL DR'" v = utils.parse_add_info(s) self.assertEqual(v, "keileem|Formatie van Drente|")
def parse_add_info_as_string(data_rows_soil): add_infos = ['additional_info'] lst = [] for row in data_rows_soil: add_info = "" for i in range(len(row) - 1): if i >= 1: add_info = add_info + utils.parse_add_info(row[i]) lst.append(add_info) df_add_infos = pd.DataFrame(lst, columns=add_infos) return df_add_infos
def parse_add_info_as_string(df, data_rows_soil): return df.assign( remarks=[utils.parse_add_info("".join(row[1::])) for row in data_rows_soil] )
def parse_add_info_as_string(df, data_rows_soil): df["remarks"] = [ utils.parse_add_info("".join(row[1::])) for row in data_rows_soil ] return df