Make Python Code blazing fast
$10-300 CAD
Paid on delivery
Hello and thank you for your time. Please read the entire description and reach out if you have any questions.
So, I am in the process of building a model in Python and the entire file has about 1500 lines of codes and there are like 5 such files. I need help making these codes blazing fast. For the benefit of both you and me, I am sharing a sample code (test code) of a situation where I am dealing with a pandas dataframe that is at least 300,000 rows and 11 columns. I have a nested for loop to label the dataframe for each row in a new column.
The code is just 11 lines and I would like to see the performance comparison from your submission. Please note that this is a test job and based on the best submission I will move ahead with the full project. There is more work that these 5 files to be done too.
You are free to try eliminating for loops, using numpy vectorization, pandas vectorization but the end goal is to execute this blazing fast. For your reference the code is given below and sample data is also attached. Kindly submit your code and comparison times running the code as it is and your vectorized code for evaluation.
This is a test job so I am not paying anything for 11 lines of code. This is the evaluation criteria for the bigger project. I will be discussing timeline and costing once finalized.
Code -
for i in range(len(df) - timeframe):
calc = df['Close'].iloc[i] * (1 + percentage)
subset = df['Close'].iloc[i+1:i+timeframe+1]
if percentage < 0:
direction = 'short'
else:
direction = 'long'
for price in subset:
if (direction == 'long' and price >= calc) or (direction == 'short' and price <= calc):
df['label'].iloc[i] = 1
break
df = dataframe
percentage = variable (assign any value you want for trial)
timeframe = variable (assign any value you want for trial)
long and short = labels
Close = column in df
label = column in df (to be created)
Project ID: #36169729
About the project
14 freelancers are bidding on average $168 for this job
Python expert. I can do it. As 9+ years experiences in these field. I can give good quality work. I have read the guidelines of your work.I believe that i can provide you the best quality works you are anticipating fro More
Hi there, How are you? I have gone through your project details. I would like to tell you that l have a great bunch of experience in Vectorization, Python, NumPy, Pandas and Software Architecture. For that I would req More
Hi. How are you? I have just read your proposal and I am sure I can complete the project on time. I am a mathematician who has 15 years of experiences in Numerical Analysis using Matlab/Python, .... Please contact me More
Hello! I will make python code fast. I assure you to deliver high-quality work with a fast turnaround. Looking forward to hearing from you. Regards Munish Gupta.
✅ Full Experiences and Profound Knowledge in ⭐Data Processing with Python Programming⭐✅. Hi, how are you? I am very confident to complete your project perfectly. I can start your work right now. Of course, since I am n More
Hi, Dear Employer, I am interested in your project – “Make Python Code blazing fast”. I have read your whole Project description carefully and understand your requirements well. Now I can say with confident that I can More
hi I'm professional electrical engineer and I have sound knowledge about it so please text me over chat to discuss further this bid is negotiable we can discuss about deadline and budget
Hi. I am a python epert. I have just read your detail carefully and I can make python code perfectly. I am really interested in your project. I have 9+ years experience doing similar jobs related to these skills Python More
Hello, I am a python developer with over 5+ years of experience i can help resolve your this issue in very efficient way.
I am a 4+ Years experienced Python Professional working in the domain of Data Science and Analytics along with experience in Fintech, E-COmmerce, FMCG and more. I believe I'd be able to solve your issue and get you th More