I'm trying to plot a scatter using ggplot but im unable to get it to work, any ideas?
dataframe and packages installed
import numpy as np
from plotnine import *
import matplotlib.pyplot as plt
#scatter plot
locations = accidents[['Latitude','Longitude']]
locations
Latitude Longitude
0 51.508057 -0.153842
1 51.436208 -0.127949
Code attempted:
(ggplot(locations(x = 'Latitude', y = 'Longitude', colour = 'red')) +
geom_point())
Error code;
TypeError Traceback (most recent call last)
/var/folders/8_/2k6q9p1s4vg_6bqjd8zpqtzm0000gn/T/ipykernel_65786/2478097116.py in.
<module>
----> 1 (ggplot(locations(x = 'Latitude', y = 'Longitude', colour = 'red')) +
2 geom_point())
TypeError: 'DataFrame' object is not callable