Make Python Code blazing fast

Cancelled Posted 1 year ago Paid on delivery
Cancelled 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)

Python Software Architecture NumPy Pandas Vectorization

Project ID: #36169729

About the project

14 proposals Remote project Active 1 year ago

14 freelancers are bidding on average $168 for this job

merinsinha

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

$205 CAD in 3 days
(89 Reviews)
5.8
rashidamjad

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

$175 CAD in 16 days
(10 Reviews)
5.0
sybacdesigner

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

$100 CAD in 1 day
(14 Reviews)
4.9
anaya8777

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.

$155 CAD in 3 days
(11 Reviews)
4.7
KawlCarter

✅ 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

$100 CAD in 1 day
(17 Reviews)
4.5
programmingarena

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

$100 CAD in 2 days
(15 Reviews)
3.8
SabirLashari

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

$155 CAD in 7 days
(2 Reviews)
2.6
yelenauniya

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

$150 CAD in 3 days
(1 Review)
2.8
malkesh3m

⭐⭐⭐ Hi, My availability: Immediate. I read your project post of Python Developer. I am Python developer with skill sets in - Python, Django, Flask, jupyter notebook - Data Science - SQlAlchemy, PostegresDB, MySQL, Sq More

$200 CAD in 3 days
(8 Reviews)
3.2
ishanagrawal1101

Hello, I am a python developer with over 5+ years of experience i can help resolve your this issue in very efficient way.

$155 CAD in 3 days
(0 Reviews)
0.0
prateekjain6342

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

$300 CAD in 7 days
(0 Reviews)
0.0