def read_excel(self, file):
# TODO: add iterator and return columns
excel_tab = pd.read_excel(file, dtype=str)
columns = excel_tab.columns
def make_gen(excel_tab, chunksize):
cursor = 0
chunk = excel_tab.iloc[:chunksize]
while chunk.shape[0]:
yield chunk
cursor += chunksize
chunk = excel_tab.iloc[cursor:cursor+chunksize]
tab = make_gen(excel_tab, self.CHUNKSIZE)
tab = (self._clean_header(tab_part) for tab_part in tab)
return tab, None, None, self._clean_column_names(columns)
normalizer.py 文件源码
python
阅读 33
收藏 0
点赞 0
评论 0
评论列表
文章目录