socceranalysis.viz_stats

Module Contents

Functions

soc_viz_stats_scatter(x_col, y_col, df)

Create a scatter plot of two chosen numerical features.

soc_viz_stats_hist(x_col, df)

Create a histogram of one chosen numerical feature.

socceranalysis.viz_stats.soc_viz_stats_scatter(x_col, y_col, df)[source]

Create a scatter plot of two chosen numerical features.

Parameters:
  • x_col (str) – name of the feature in horizontal axis.

  • y_col (str) – name of the feature in vertical axis.

  • df (pandas dataframe) – The dataframe of the feature

Returns:

Chart – an altair chart

Return type:

altair.vegalite.v4.api.Chart

Examples

>>> data = pd.read_excel("soccer_data.xlsx")
>>> soc_viz_stats_scatter('age', 'Wages_Euros', data)
socceranalysis.viz_stats.soc_viz_stats_hist(x_col, df)[source]

Create a histogram of one chosen numerical feature.

Parameters:
  • x_col (str) –

    name of the feature in horizontal axis.

    name of the feature in vertical axis.

  • df (pandas dataframe) – The dataframe of the feature

Returns:

Chart – an altair chart

Return type:

altair.vegalite.v4.api.Chart

Examples

>>> data = pd.read_excel("soccer_data.xlsx")
>>> soc_viz_stats_hist('age', data)