Make Python Code blazing fast

Peruttu Julkaistu 1 vuosi sitten Maksettu toimituksen yhteydessä
Peruttu Maksettu toimituksen yhteydessä

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 Tietojärjestelmäarkkitehtuuri NumPy Pandas Vektorointi

Projektin tunnus: #36169729

Tietoa projektista

14 ehdotusta Etäprojekti Aktiivinen 1 vuosi sitten

14 freelanceria on tarjonnut keskimäärin $168 tähän työhön

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 Lisää

$205 CAD 3 päivässä
(89 arvostelua)
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 Lisää

$175 CAD 16 päivässä
(10 arvostelua)
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 Lisää

$100 CAD 1 päivässä
(14 arvostelua)
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 3 päivässä
(11 arvostelua)
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 Lisää

$100 CAD 1 päivässä
(17 arvostelua)
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 Lisää

$100 CAD 2 päivässä
(15 arvostelua)
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 7 päivässä
(2 arvostelua)
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 Lisää

$150 CAD 3 päivässä
(1 arvostelu)
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 Lisää

$200 CAD 3 päivässä
(8 arvostelua)
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 3 päivässä
(0 arvostelua)
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 Lisää

$300 CAD 7 päivässä
(0 arvostelua)
0.0