-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdfexcel easy.py
More file actions
68 lines (63 loc) · 1.81 KB
/
Copy pathdfexcel easy.py
File metadata and controls
68 lines (63 loc) · 1.81 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#TradeClients.xlsx
#C:\Users\u\Documents\My Tableau Repository\Datasources\
# create all variables
import openpyxl
wb = openpyxl.load_workbook('C:\\Users\\u\\Documents\\My Tableau Repository\\Datasources\\TradeClients.xlsx')
ws = wb['Clients']
data_rows = []
#for row in ws['A1':'T1000']:
count_row_ss=0
for row in ws:
count_row_ss = count_row_ss + 1
data_cols = []
for cell in row:
data_cols.append(cell.value)
if 'Wholesaler' in data_cols:
data_rows.append(data_cols)
print (data_rows[0:5])
count = 0
for row in data_rows:
count = count + 1
print(row[0:3])
print ('Count of Wholesalers', count)
print ('Count of Wholesalers', len(data_rows))
print ('Row Count in Spreadsheet', count_row_ss)
print ('Number of columns', len(data_cols))
ws = wb['Products']
data_rows = []
count_row_ss=0
for row in ws:
count_row_ss = count_row_ss + 1
data_cols = []
for cell in row:
data_cols.append(cell.value)
data_rows.append(data_cols)
print (data_rows[0:5])
count = 0
for row in data_rows:
count = count + 1
print(row[0:3])
print ('Count of products', count)
print ('Count of products', len(data_rows))
print ('Row Count in Spreadsheet', count_row_ss)
print ('Number of columns', len(data_cols))
print (type(ws))
ws = wb['Sheet1']
data_rows = []
count_row_ss=0
for row in ws:
count_row_ss = count_row_ss + 1
data_cols = []
for cell in row:
data_cols.append(cell.value)
data_rows.append(data_cols)
print (data_rows[0:5])
count = 0
for row in data_rows:
count = count + 1
print(row[0:])
print ('Count of products', count)
print ('Count of products', len(data_rows))
print ('Row Count in Spreadsheet', count_row_ss)
print ('Number of columns', len(data_cols))
print (type(ws))