Initial commit
This commit is contained in:
17
read_pizza_excel.py
Normal file
17
read_pizza_excel.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import pandas as pd
|
||||
|
||||
# 讀取 Excel 檔案
|
||||
file_path = "c:\\AI_Program\\C0908\\Data\\pizza.xlsx"
|
||||
|
||||
def read_excel():
|
||||
try:
|
||||
# 使用 pandas 讀取 Excel
|
||||
data = pd.read_excel(file_path)
|
||||
print("資料內容:")
|
||||
print(data.head())
|
||||
return data
|
||||
except Exception as e:
|
||||
print(f"讀取 Excel 檔案時發生錯誤: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
read_excel()
|
Reference in New Issue
Block a user