-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery_csv
More file actions
20 lines (14 loc) · 687 Bytes
/
query_csv
File metadata and controls
20 lines (14 loc) · 687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import pandas as pd
df = pd.read_csv(".\Systems_Full_Inventory.csv")
df['SYSTEM'].astype('|S')
df['APPLICATION'].astype('|S')
df['PRIMARY TECHNICAL CONTACT'].astype('|S')
df['ADDITIONAL CONTACTS'].astype('|S')
while True:
sys = input("Which system would you like POC info for? ")
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)))]
final = result[['APPLICATION', 'PRIMARY TECHNICAL CONTACT', 'ADDITIONAL CONTACTS']]
if(len(final) == 0):
print("Not found!")
if sys == 'stop' : break
print(final.to_string(index=False))