Im stuck on an assignment where they have us use data from
https://raw.githubusercontent.com/Geoyi/Cleaning-Titanic-Data/master/titanic_original.csv
Using matplotlib I need to:
Create a scatterplot with the Fare paid and the Age, differ the plot color by gender.
So far I am having trouble getting the color to be plotted by the gender.
So far this is what I have:
import pandas as pd
import matplotlib.pyplot as plt
titanic = pd.read_csv('https://raw.githubusercontent.com/Geoyi/Cleaning-Titanic-Data/master/titanic_original.csv')
plt.scatter(titanic['age'],titanic['fare'],alpha=0.5)
plt.show()
When I tried this:
plt.scatter(titanic['age'],titanic['fare'], alpha=0.5,c=titanic['sex'])
plt.show()
it gave me a raise ValueError(msg.format(c.shape, x.size, y.size))