I have a table named as TRENDS, containing around 20k records. I need to manipulate each row of TRENDS table based on the each column value and final output of the row is a string, named insight which is nothing but that manipulated row. And then i need to store that insight into a INSIGHTS table. Along with a insight i am generating 3 more queries which are in three seprate functions. Result of each query is get stored into another table called FACTS along with a insight_id to indicates that these 3 facts belongs to the same insight.

Since the data is in mysql database I used mysql-connector library of python to run on my scripts for retrieval and insertion operations.
  With each insight and 3 facts i am performing execute() and commit() which is taking 3 sec for one set of record to insert and these is 20k recods in TRENDS table which is taking lot of time to complete.

What is the fastest way to solve this problem?
Please suggest a better algo if possible.
We'll be able to provide much more help if you can provide a sample of the data in each table and your desired output. Here are some very general pointers based on what you've said:

There are a lot of overheads to excuting a query, if you read and write one line at a time you will waste a huge amount of execution time waiting for queries to execute
Bulk operations are much faster, why not read all 20k rows at once then write 20k back, or if that's too demanding on your local system why not do 1000 at a time?
...or see if you can write a query which completes the entire operation in SQL
What is the fastest way to implementing algorithm to manipulate and insert sql records?