I have a dataframe as follows:
id country amount city
1 France 4 Paris
2 Italy 9 Naples
I want to convert it to
id amount city France Italy
1 4 Paris 1 0
2 9 Naples 0 1
How can I achieve this using Pandas and Pyspark respectively?