首页 > 解决方案 > Getting CSV sheet name with python

问题描述

Is there something similar or equivalent to get CSV file sheet name, such as pd.ExcelFile(file), sheet_names, for excel files?

xl = pd.ExcelFile(file)

xl.sheet_names

标签: pythonexcelpandascsv

解决方案


@pavel, answered the question, thanks guys. CSV is a text file. It doesn't have sheet names. Note that any CSV you open in Excel will automatically have only one sheet named 'Sheet1'. – pavel Jun 12 at 2:38


推荐阅读