excel codes tanghih
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class ExcelHelper:
|
||||
def __init__(self):
|
||||
self.pd = null
|
||||
self.data_dict = []
|
||||
|
||||
|
||||
|
||||
def load_data(self, file_path, sheet_name=0):
|
||||
df = pd.read_excel(file_path, sheet_name=sheet_name)
|
||||
return df
|
||||
|
||||
|
||||
# def load_data(self, file_path, sheet_name):
|
||||
# df = pd.read_excel(file_path, sheet_name=sheet_name)
|
||||
# selected_columns = df[[self.fltxt_column_name]]
|
||||
# self.data_dict = selected_columns.to_dict(orient='records')
|
||||
|
||||
# for record in self.data_dict:
|
||||
# record['_id'] = " "
|
||||
|
||||
# print("✅ دادهها با موفقیت از فایل اکسل خوانده شدند.")
|
||||
Reference in New Issue
Block a user