[Python] TypeError: pointplot() got an unexpected keyword argument 'alpha'

Discussão em 'Python' iniciado por Stack, Junho 4, 2025.

  1. Stack

    Stack Membro Participativo

    import kagglehub
    # Download latest version
    path = kagglehub.dataset_download("jayrav13/unemployment-by-county-us")

    import pandas as pd
    df = pd.read_csv(path)
    print(df)

    import numpy as np
    import seaborn as sns
    import matplotlib.pyplot as plt

    #Let us check for the county with the highest unemployment rate
    Exp = df.groupby('Rate').max()
    Exp

    #Getting rows of San Juan County Colorado only
    c = df.loc[(df['County']=='San Juan County') & (df['State']=='Colorado')]
    #print(c)

    #Plotting San Juan unemployment rate around the years surrounding 1990s Recession
    fig, (ax1, ax2, ax3) = plt.subplots(1, 3,figsize=(30,8))
    group = c.loc[c['Year']==1990]
    sns.pointplot(group['Month'], group['Rate'], alpha=0.8, ax=ax1)

    plt.show()



    logs as below:
    Traceback (most recent call last):
    File ".\unEmploymentRate_kaggle.py", line 46, in
    sns.pointplot(group['Month'], group['Rate'], alpha=0.8, ax=ax1)
    TypeError: pointplot() got an unexpected keyword argument 'alpha'

    Continue reading...

Compartilhe esta Página