This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from geopy.geocoders import Nominatim | |
from geopy import distance | |
geolocator = Nominatim() | |
my_location = geolocator.geocode("Russia, Saint-Petersburg") | |
user_location = geolocator.geocode("Russia, Moscow") | |
my_coords = ((my_location.latitude, my_location.longitude)) | |
user_coords = ((user_location.latitude, user_location.longitude)) | |
print(distance.vincenty(my_coords, user_coords).km) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numpy import sqrt, arange | |
import matplotlib.pyplot as plt | |
G = 6.67384e-11 # Gravitational constant, m3 kg-1 s-2 | |
M = 1.989e30 # Mass of Sun, kg | |
x = 1.475e11 # Perihelion Sun-Earth distance | |
y = 0 | |
r = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from matplotlib import pyplot as plt | |
n = 9 | |
def who_is_best(func): | |
t0 = time.time() | |
for i in func: | |
i = i**2 | |
delta_t = time.time() - t0 |