目录
1. List转DataFrame
2. 计算相关系数
3. index重新排序
4. 两个DataFrame根据某一列的值合并(列增多)
5. DataFrame A列值相同,B列值相加/平均
6. 列名相同的DataFrame竖着合并(行增多)
7. DataFrame按某列的值排序
8. DataFrame多条件查询
# result是二维列表[[a,1],[b,2],[c,3]]
data = pd.DataFrame(result)
data.columns = ['col1', 'col2']
data
corr = round(data['time'].corr(data['money']), 4)
projects = projects.reset_index(drop=True)
data = pd.merge(data1, data2, on='projuuid')
supports = supports.groupby(by=['time'])['money'].sum()
supports = supports.groupby(by=['time'])['money'].mean()
data = pd.concat([data2,data1])
test = test.sort_values("time")
wuhan.loc[(wuhan["type"]=='exp') & (wuhan["success"]==0), :]