Skip to content

Commit bfe1a99

Browse files
Update query_csv
1 parent 6e9b1be commit bfe1a99

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

query_csv

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import pandas as pd
22

3-
df = pd.read_csv("/Users/reginaldstuart/Documents/IT/llama3/table.csv")
3+
df = pd.read_csv(".\Systems_Full_Inventory.csv")
44

5-
df['Event'].astype(str)
6-
df['Date'].astype(str)
7-
df['Details'].astype(str)
5+
df['SYSTEM'].astype('|S')
6+
df['APPLICATION'].astype('|S')
7+
df['PRIMARY TECHNICAL CONTACT'].astype('|S')
8+
df['ADDITIONAL CONTACTS'].astype('|S')
89

910
while True:
1011

11-
holiday = input("Which holiday/event are you looking for? ")
12-
result = df.loc[(df['Event'].str.contains(holiday, case=False)) | (df['Details'].str.contains(holiday, case=False))]
13-
final = result[['Date', 'Event', 'Details']]
12+
sys = input("Which system would you like POC info for? ")
13+
result = df.loc[(df['SYSTEM'].str.contains(sys, case=False, na=False)|(df['INTERNAL IP'].str.contains(sys, case=False)) |(df['EXTERNAL IP'].str.contains(sys, case=False, na=False)))]
14+
final = result[['APPLICATION', 'PRIMARY TECHNICAL CONTACT', 'ADDITIONAL CONTACTS']]
1415

15-
if(len(final) == 0):
16-
print("Not found")
16+
if(len(final) == 0):
17+
print("Not found!")
1718

18-
if holiday == 'stop' : break
19-
print(final.to_string(index=False))
19+
if sys == 'stop' : break
20+
print(final.to_string(index=False))

0 commit comments

Comments
 (0)