I have a csv file with the following format:
+--------------+--------+--------+--------+
| Description | brand1 | brand2 | brand3 |
+--------------+--------+--------+--------+
| afkjdjfkafj | 1 | 0 | 0 |
| fhajdfhjafh | 1 | 0 | 0 |
| afdkjfkajljf | 0 | 1 | 0 |
+--------------+--------+--------+--------+
I want to write a python script that reads the csv and create a table in sql. I want the table to have the description and the derived brand. If there is a one in the brand name column of the csv then the description is associated with that brand. I want to then create a sql table with the description and the associated brand name.
The table will be :
+-------------+---------------+
| Description | derived brand |
+-------------+---------------+
| afkjdjfkafj | brand 1 |
+-------------+---------------+
So far I have written the code for reading the csv and made the descriptions a list.
df = pd.read_csv(SOURCE_FILE, delimiter=",")
descriptions = df['descriptions'].tolist()
Please provide some guidance on how to read the file and achieve this because I am so lost. Thanks!