Is there a way to use the apply function and pass the name of the specific row and column of each cell as arguments? In other words, I want to perform an operation to the cartesian product of two sets. Example:
countries = ["Germany", "France", "Belgium"]years = [2030, 2040, 2050]df = pandas.DataFrame(columns = countries, index = years)def myFunc(countryname, year): return countryname + str(year)df.apply(myFunc) # I don't know how to pass the arguments
Maybe there is another way to do this without using nested for-loops?