-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1.lat_long.py
More file actions
27 lines (22 loc) · 777 Bytes
/
1.lat_long.py
File metadata and controls
27 lines (22 loc) · 777 Bytes
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
26
27
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
birddata = pd.read_csv("bird_tracking.csv")
bird_names = pd.unique(birddata.bird_name)
# storing the indices of the bird Eric
ix = birddata.bird_name == "Eric"
x,y = birddata.longitude[ix], birddata.latitude[ix]
plt.figure(figsize = (7,7))
plt.plot(x,y,"b.")
''' To look at all the birds trajectories,
we plot each bird in the same plot '''
plt.figure(figsize = (7,7))
for bird_name in bird_names:
# storing the indices of the bird Eric
ix = birddata.bird_name == bird_name
x,y = birddata.longitude[ix], birddata.latitude[ix]
plt.plot(x,y,".", label=bird_name)
plt.xlabel("Longitude")
plt.ylabel("Latitude")
plt.legend(loc="lower right")
plt.show()