我在sqlite中创建了一个数据库,它是从pandas的字典中创建的,数据帧是从csv的文件中创建的。当我将数据库导入sqlite时,每个表名都以“.csv”结尾,我如何删除它?在
代码如下:
import os
import glob
import pandas as pd
files = glob.glob(os.path.join("staging" + "/*.csv"))
print(files)
# Create an empty dictionary to hold the dataframes from csvs
dict_ = {}
# Write the files into the dictionary
for file in files:
fname = os.path.basename(file)
dict_[fname] = pd.read_csv(file, header = 0, dtype = str, encoding = 'cp1252').fillna('')
对于sqlite数据库:
^{pr2}$
目前没有回答
相关问题 更多 >
编程相关推荐