searchAirportInfoByCity()

Programming Language: Python 3 (As of Jan 2022)

Description


Travel() must be initialized first before calling searchAirportInfoByCity(). Using Pandas, it will read the database that has 9300 airports and search it by the desired city 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 city

Calling Example


        
            atlanta.searchAirportInfoByCity()
        
        
    

Class Code


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

Required Database of 9300 Airports


Download Database