I have a dataframe of footballers and their premier league fantasy football stats, I would like to create line plots for each player (x-axis: gameDate, y-axis: points)
Below is a def I created that filters the dataframe based on the player name and attempts the lineplot.
def PlotPlayerPoints(df, player):
df = df.copy()
df = df.filter(like=player, axis=0)
plt.figure(figsize=(20,6))
plt.title(player)
sns.lineplot(data=ffmlDf, x="gameDate", y="points", estimator=None)
for player in ffmlDf['playerName'].unique():
PlotPlayerPoints(ffmlDf, player)
The lineplot comes through as the exact same for each player, so my attempt at filtering clearly did not work.
