repl.it
@potatosmurfer/

Shipstracker

Python

No description

fork
loading
Files
  • main.py
  • skipsdata.csv
  • skipsdata02.csv
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from ipyleaflet import Map, Marker, Circle, CircleMarker, LayerGroup, basemaps, Polyline

df1 = pd.read_csv("skipsdata.csv")
df2 = pd.read_csv("skipsdata02.csv")
df = df1.append(df2)

temp = df.sea_temperature
print(str(sum(temp.dropna() / len(temp.dropna()))) + " Celcius is the average water temperature")

m = Map(center=(65, 10), zoom=4, basemap=basemaps.Hydda.Full)
m

length = 20000
longitude = df.longitude[0:length]
latitude = df.latitude[0:length]
coords = []

for x in range(len(longitude)):
    coords.append((latitude[x], longitude[x]))

line = Polyline(locations=coords, color="green", Fill=False, weight=1)
m.add_layer(line)
?