From 2b9d790890c71bb06aee7f30dc9b300b0657096a Mon Sep 17 00:00:00 2001 From: AbdoullahBougataya Date: Wed, 7 Aug 2024 06:44:02 +0000 Subject: [PATCH] Wed, Aug 7, 2024, 9:44 AM +03:00 --- scrapper.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scrapper.py b/scrapper.py index 569fe96..d7c0cec 100644 --- a/scrapper.py +++ b/scrapper.py @@ -42,14 +42,14 @@ def scrapper(): if string_element.find('Д') != -1 or string_element.find('8D6') != -1 or string_element.find('11D2') != -1 or string_element.find('11D5') != -1 or string_element.find('15D1') != -1 or string_element.find('15D3') != -1: string_element = string_element.split()[0] # Split the specific impulse column into Isp in the vaccum and Isp in the sea level - if titles[j] == 'Specific impulse Vac (s)' and (len(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ").split()) > 1): # or i in [17, 28] + if titles[j] == 'Specific impulse Vac (s)' and (len(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ").split()) > 1 or i in [17, 27]): # Change the Isps intervals to medians if string_element.find('–') != -1: row += tuple(map(float, [(float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ").split()[0].split('–')[0]) + float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ").split()[0].split('–')[1])) / 2, (float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ").split()[1].split('–')[0]) + float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ").split()[1].split('–')[1])) / 2])) - # elif i == 17: - # row += tuple(map(float, [float(re.sub("\(.*?\)","()", string_element).replace("()", "")[0:3]), float(re.sub("\(.*?\)","()", string_element).replace("()", "")[2:6])])) - # elif i == 28: - # row += tuple(map(float, [float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ")[0:3]), float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ")[3:6])])) + elif i == 17: + row += tuple(map(float, [float(re.sub("\(.*?\)","()", string_element).replace("()", "")[0:3]), float(re.sub("\(.*?\)","()", string_element).replace("()", "")[2:6])])) + elif i == 27: + row += tuple(map(float, [float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ")[0:3]), float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ")[3:6])])) else: row += tuple(map(float, [float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ").split()[0]), float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ").split()[1])])) elif titles[j] == 'Specific impulse Vac (s)' and string_element[string_element.find("(")+1:string_element.find(")")] == 'Vac':