我有几个数据框要附加到 python 中的 csv 文件。我正在使用以下代码来实现这一点,但还没有运气。
import csv as writer
import pandas as pd
def append_list_as_row(list_of_elem):
# Open file in append mode
with open('my_file.csv', 'a+', newline='') as write_obj:
# Create a writer object from csv module
csv_writer = writer(write_obj)
# Add contents of list as last row in the csv file
csv_writer.writerow(list_of_elem)
append_list_as_row(new_data_frame)
抛出以下错误:
TypeError: 'module' object is not callable
任何人都可以帮我解决这个问题吗?