Python Forum
Output variables from a list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Output variables from a list
#1
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

    #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)
Reply


Messages In This Thread
Output variables from a list - by MTom5 - Aug-12-2018, 08:53 PM
RE: Output variables from a list - by scidam - Aug-12-2018, 11:13 PM
RE: Output variables from a list - by perfringo - Aug-13-2018, 08:47 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020