searchAirportInfoByCountry()

Programming Language: Python 3 (As of Jan 2022)

Description


Travel() must be initialized first before calling searchAirportInfoByCountry(). Using Pandas, it will read the database that has 9300 airports and search it by the desired country you used to intialize Travel().

Parameters


self (None; however read description)

  Value of this must be a string of a correctly spelled location.

  location string needs to be a country

Calling Example


        
            luxemburg.searchAirportInfoByCountry()
        
        
    

Class Code


        
            def searchAirportInfoByCountry(self):
              data = pd.read_excel(Global Airport Database.xlsx", sheet_name= "GlobalAirportDatabase")
              df = pd.DataFrame(data)
              print (df.loc[df["Country"].str.contains(self.location.upper())])
              print("\n")
        
    

Required Database of 9300 Airports


Download Database