admin管理员组

文章数量:1332361

NameError Traceback (most recent call last) Cell In[38], line 16 14 def analyze_preparedness(df, variable): 15 urban_counts = df[[f'Urban_{level}' for level in ['Not_at_all', 'Somewhat', 'Quite_bit', 'Very_much']]].loc[df['Variable'] == variable].values[0] ---> 16 rural_counts = df[[f'Rural_{level}' for level in ['Not_at_all', 'Somewhat', 'Quite_bit', 'Very_much']]].loc[df['Variable'] == variable].values[0] 17 p_value = df['P-value'][df['Variable'] == variable].values[0] 19 urban_total = sum(urban_counts)

NameError: name 'variable' is not defined

本文标签: variablesIs there a python function to make comparisonStack Overflow