我想在python中使用for循环从csv文件合并一些数据帧。但结果是空的。为什么会这样?这是我的代码。
result = pandas.DataFrame(columns = ['col_A', 'col_B'])
for i in range(0, 5):
#col_A is integer for numbering, col_B is float in range 0 to 1
temp = pandas.DataFrame([[0, 0.5132443], [1, 0.12436421], [2, 0.12341162]], columns = ['col_A', 'col_B'])
result.merge(temp)
print(result) #result is empty dataframe
答案 0 :(得分:1)
您需要存储合并的结果:
CREATE TRIGGER
MY_REPLICATOR
ACTIVE AFTER INSERT OR UPDATE OR DELETE
POSITION 99
ON MY_TABLE
AS
BEGIN
/*INSIDE THE UDF IT IDENTIFIES THE CURRENT TABLE-ROW
AND REPLICATE ALL COLUMNS VALUES TO MY MONGODB*/
MY_UDF_REPLICATION(OLD, NEW);
END
来自(DOCS
返回:
合并:DataFrame
如果输出类型是DataFrame的子类,则输出类型将与“left”相同。