我有一个json文件
{ "teams":{
"0":"Liverpool",
"1":"Liverpool",
"2":"Arsenal",
"3":"City",
"4":"Watford",
"5":"Liverpool",
"6":"Chelsea"
}
}
代码:
df = pd.read_csv("clubs.csv")
clubs_df= pd.read_json('domain.json')
clubs =pd.DataFrame.from_dict(clubs_df)
df = df.stack()
df = df.append(clubs)
df = df.value_counts()
df = df.reset_index()
print(df)
如果我尝试将这些值添加到堆栈中,则会出现以下错误:TypeError: to_append should be a Series or list/tuple of Series, got DataFrame
目前没有回答
相关问题 更多 >
编程相关推荐