I´m using pandasql library in Python to make an special query of DataFrames, I trying to make a new row number column from the combination of some columns. I have the next example:
tabla_1= pd.DataFrame(['a','b','c'],columns=['letras'])
tabla_2= pd.DataFrame([1,2],columns=['numeros'])
tabla_3= pd.DataFrame(['rojo','verde'],columns=['colores'])
pysqldf = lambda q: sqldf(q, globals())
# Here is my query that doesn't work
q = '''
SELECT
letras,
numeros,
colores,
ROW_NUMBER() OVER (PARTITION BY (letras||numeros))
FROM
tabla_1 CROSS JOIN tabla_2 CROSS JOIN tabla_3
'''
pysqldf(q)
The table without the row number looks like this:

And the table with the new row number should look like this:

Row number should create a different number depending on the combinatio of the columns 'letras' and 'numeros'.
I appreciate the help!
No need to use pandasql, you can easily do this using builtin pandas methods:
Result