forked from inmine2/FilesManagement
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNoteBook.py
More file actions
25 lines (22 loc) · 732 Bytes
/
Copy pathNoteBook.py
File metadata and controls
25 lines (22 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import pandas as pd
class NoteBook:
def __init__(self,NoteBookPath,sheetname):
self.ZhuanZu=pd.read_excel(NoteBookPath,sheet_name=sheetname,parse_dates=True)
self.ZhuanZu.fillna('',inplace=True)
self.index = self.ZhuanZu.columns.tolist()
self.info=[]
print(self.ZhuanZu)
def eachContract(self,lineno):
try:
self.info = self.ZhuanZu.iloc[lineno].tolist()
except:
self.info=self.index
print(self.info)
return self.info
if __name__ == '__main__':
path = '文件管理.xlsx'
sheetname = '欧洲'
note=NoteBook(path,sheetname)
note.eachContract(1)
print(note.index)
print(note.info)