Convert python code to a function (Machine Learning)

Job ID: 34359101

Budget: $10 – $30 USD

I have a perfect and working code in python, however, I want a few improvements as follows:
1.) Convert the code to a function of two dataframes (Function(historical_data, upcoming_data)
2.) Maintain same reports (output dataframes)
3.) Improve accuracy and speed if you can
4.) Set it up to run online at least once a day