Aug-12-2018, 08:53 PM
I have the following code that uses Pandas and filters an excel spreadsheet containing IP Addresses.
The code filters the spreadsheet and narrows it down to 2 rows and then prints the result.
How do i get the contents of this list separate and not including the index so i can use them as variables
i.e as:
IP_Add_1 = 10.123.4.5
IP_Add_2 = 10.123.4.6
The code filters the spreadsheet and narrows it down to 2 rows and then prints the result.
How do i get the contents of this list separate and not including the index so i can use them as variables
i.e as:
IP_Add_1 = 10.123.4.5
IP_Add_2 = 10.123.4.6
#Filter rows by column E (Station name) for results with cell = Asset No. (i.e "G04") xlsx_filter1 = IP_Plan.index[IP_Plan['Station name'] == IPP2.get()].tolist() IP_Plan = IP_Plan.loc[xlsx_filter1,:] #Filter rows by column C (Type) for results with cell = Device Type (i.e "IP Telephone - Norphonic N-K1") xlsx_filter2 = IP_Plan.index[IP_Plan['Type'] == "IP Telephone - Norphonic N-K1"].tolist() IP_Plan = IP_Plan.loc[xlsx_filter2,:] #File cell value by column B (IP address) Output_IP_Address = IP_Plan["IP address"] print(Output_IP_Address)