-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path000.py
118 lines (93 loc) · 2.7 KB
/
000.py
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import copy
import pandas as pd
def main():
print("Hello World!")
if __name__ == "__main__":
main()
'''
print("Guru99_01")
l=[i for i in range(3,9)]
print(l)
E0 = [[1, 2, 3,4], [ 5, 6,7,8], [9,10,12,11]]
E0_copy = E0
E1_copy = list(E0)
E3_copy = copy.deepcopy(E0)
E4_copy = E0[:]
ES=E0[:]
E0=sorted(E0)
print('E0:',E0) # -> [[0, 2, 3], [4, 0, 6], [7, 8, 0]]
print('E0_c:',E0_copy) # -> [[0, 2, 3], [4, 0, 6], [7, 8, 0]]
print('E1_c:',E1_copy) # -> [[0, 2, 3], [4, 0, 6], [7, 8, 0]]
print('E3_c:',E3_copy) # -> [[0, 2, 3], [4, 0, 6], [7, 8, 0]]
print('E4_c:',E4_copy) # -> [[0, 2, 3], [4, 0, 6], [7, 8, 0]]
print('ES:',ES) # -> [[0, 2, 3], [4, 0, 6], [7, 8, 0]]
E0_copy[0][0] = 0
E1_copy[1][1] = 0
E3_copy[2][3] = 111
E4_copy[0][3] = 999
print('E0:',E0) # -> [[0, 2, 3], [4, 0, 6], [7, 8, 0]]
print('E0_c:',E0_copy) # -> [[0, 2, 3], [4, 0, 6], [7, 8, 0]]
print('E1_c:',E1_copy) # -> [[0, 2, 3], [4, 0, 6], [7, 8, 0]]
print('E3_c:',E3_copy) # -> [[0, 2, 3], [4, 0, 6], [7, 8, 0]]
print('E4_c:',E4_copy) # -> [[0, 2, 3], [4, 0, 6], [7, 8, 0]]
print('ES:',ES) # -> [[0, 2, 3], [4, 0, 6], [7, 8, 0]]
numbers=[12, 5, 34, 11]
print('numbers:',numbers)
backUp = numbers[:] # this is link, not deep copy
numbers = sorted(numbers) # but sorted created a deep copy
print('numbers after sort:',numbers)
print('backUp:',backUp)
s='012345'
print(s[:3])
f='filename.ext'
print(f[:-5])
#define result location
path = r'D:\powershell'
#files = os.listdir(path)
#reading sheets
#for file in files:
file='processes_0418.xlsx'
df_temp = pd.read_excel(path +"\\"+file, skiprows=6,usecols='A:G').dropna()
df_temp['Filename'] = file[:-5]
print(df_temp)
'''
# concatenate.py
def concatenate(**kwargs):
result = ""
# Iterating over the Python kwargs dictionary
#for arg in kwargs.values():
# result += arg
argTuples=kwargs.items()
print(argTuples)
for aT in argTuples:
print(aT)
print(type(kwargs.items()))
print(type(kwargs.keys()))
print(type(kwargs.values()))
print(' '.join(kwargs.keys()))
result = ' '.join(kwargs.values())
return result
print(concatenate(a="Real", b="Python", c="Is", d="Great", e="!"))
def updatelist(li):
print(type(li))
li[0]='x'
return
my_list = [1, 2, 3]
print(my_list)
print(*my_list)
updatelist(my_list)
print(my_list)
def my_sum(a, b, c):
print(a + b + c)
my_list = [1, 2, 3]
my_sum(*my_list)
#my_sum(my_list)
my_list = [1, 2, 3, 4, 5, 6]
a, *b, c = my_list
print(a,type(a))
print(b,type(b))
print(c,type(c))
*a, = "RealPython"
print(a,type(a))
print('2022-06-19')
print('2022-06-19_2')