我正在努力提取有关入学学生性别的信息。我的目标是比较女性和男性。
import matplotlib.pyplot as plt
import education
list_of_record = education.get_all_states ()
virginia_education = education.get_state ('Virginia')
enrollment = list_of_record ['enrollment']
我试过了,但它没有用。它给了我" TypeError:列表索引必须是整数或切片,而不是str"
if enrollment in virginia_education:
female = enrollment ['gender']