cardiopolt.blogg.se

Python pandas plot scatter unique
Python pandas plot scatter unique





  1. #Python pandas plot scatter unique how to#
  2. #Python pandas plot scatter unique code#

PlayerData = pd.read_csv("playerData.csv")

python pandas plot scatter unique

# First gather the data I need and choose the display colors import pandas as pdįrom ipywidgets import Output, VBox, widgets I hope this can be expanded to meet your needs. What I have below is the ability to filter by team name, season, or player and compare two options within that filter. I ran into the problem of VSCode not being able to display widgets. Depending on your IDE, you might need to use Jupyter to get the widgets to work. So I was not able to manipulate the legend, but I could add filters through drop down widgets that I found here. In summary, I would like to have three filters, one for season, other for team, the other for players, to be able to have multiple selections in each filter, and to obtain different colors and the rest of the points greyed so I can compare the results with the rests, I am not sure if it is possible with plotly express or if I should use a different library. Hover_data=, color='season')Īnd the graph resultant is the following:

#Python pandas plot scatter unique code#

The code is the following: import plotly.express as pxįig = px.scatter(pointsperplayer, x='assisted', y='notassisted', hover_name='player',

#Python pandas plot scatter unique how to#

I am learning data science and with the library plotly express I can make the scatter plot and filter by team for example, and I can compare two different teams (or seasons or players).īut I am not able to add multiple filters in a fancy way, and also I don't know how to show the selected and put in grey the others (without disapearing them). Also I would like to compare the players of two different teams and combinations of the filters.

python pandas plot scatter unique

But I also want to filter by season, by team and by players, so when I select a determined player of a team I can see their points with one color and the other points greyed, or for example if I want to select two or more players I can compare them between them (with different colors) and that the other points are visible but greyed. In the x axis I want to put the assisted points and in the y axis the not assisted points.

python pandas plot scatter unique

I am pretending to do a scatter plots with filters of the following dataframe (that represents in a whole season the players, the team and the season, and counts the asissted and not assisted point that a player of a basketball team did): player team_name season assisted notassistedĪ.







Python pandas plot scatter unique