I want to print the variable based on the index number based on the following dataset:
Here I used the following code:
import pandas as pdairline = pd.read_csv("AIR-LINE.csv")pnr = input("Enter the PNR Number ")
index = airline.PNRNum[airline.PNRNum==pnr].index.tolist()
zzz = int(index[0])
print( "The flight number is " + airline.FlightNo[zzz] )
I get the following error:
TypeError: can only concatenate str (not "numpy.int64") to str
I know that the error is because the FlightNo
variable contains int
value. But I don't know how to solve it. Any idea?