Skip to content

Commit

Permalink
Wed, Aug 7, 2024, 9:13 AM +03:00
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdoullahBougataya committed Aug 7, 2024
1 parent 41cbc57 commit 564fdc8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ def scrapper():
row += tuple(map(float, [float(string_element.split(" ")[0])]))
row += tuple(map(str, ['']))
# Split the thrust column into Thrust in the vaccum and Thrust in the sea level
elif titles[j] == 'Specific impulse SL (s)' and (len(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ").split()) > 1 or i == 23):
elif titles[j] == 'Specific impulse SL (s)' and (len(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ").split()) > 1): # or i == 21
# Change Thrusts 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 == 23:
row += tuple(map(float, [float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ")[0:7]), float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ")[7:13])]))
# elif i == 21:
# row += tuple(map(float, [float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ")[0:7]), float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ")[7:13])]))
else:
row += tuple(map(float, [float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ").split()[0]), float(re.sub("\(.*?\)","()", string_element).replace("()", "").replace(" ", " ").split()[1])]))
# Change numbers from strings to floats
Expand Down

0 comments on commit 564fdc8

Please sign in to comment.