python pandas excel modify (small program) (5 stars) (more work)
Budget: $2 – $8 USD
FILE is ATTACHED - code here below (need asap)
Please update cleanup; here is how cleanup should be improved
STEP 1 (see attached code to modify, this is done and working. see code below)
- Row 1 needs to be deleted
- Row V needs to be deleted
STEP2
Examine EACH row one at a time
-examine the RESULTS collumn for each record
-if there is more than one line; duplicate a new record to expand and have 1 row for each
For example; if there is 3 lines of details in "results" then duplicate 3 rows and have the data for each going from 1 row to 3 with RESULTS lines having the one corresponding line
For example; if there is 9 lines of details in "results" then duplicate 9 rows and have the data for each going from 1 row to 9 with results having the one corresponding line
-example.xlsx is updated with 3 records that have multiple lines (at least) and also attached is the existing cleanup
cline1
cline2
cline3
cline4
cline5
cline6
cline7
cline8
cline9
cline10
cline11
cline12
cline13
cline14
is there a way you can see my desktop ?
let me know your thoughts and any questions
While this is hourly; there is a max of $12 that I can pay, as being a cancer patient is tuff and been out of work. Hourly will give you more $ as there is less money taken between us from freelancer
There is hope you can give your “best” price; unemployed, and have cancer with bills backing up, $12 possible? Glowing paragraph of feedback 5 stars
My funds are low but will pay quick and leave 5 stars. Please give your best possible for your bid ? (something reasonable?) Please note there is hope we can mutually complete this task; we can leave each other nice comments and 5 stars for each? Look at feedback on my profile, feedback I left for many others. Here is the project:
SINCERELY WOULD BE NICE TO MEET YOU PLEASE
ANY THOUGHTS ? Please note project is due in two hours as this projects deadline, as this is needed if we can get some done - then we can talk about next steps and 5 stars and another job also. If this is a good one and we are "successful"; would need a couple others setup, but will handle one at a time? Can you do this for something reasonable in a couple hours? 2 hours? thoughts ?
EXISTING CODE
import pandas as pd
import xlsxwriter
import numpy as np
import sys
import os
def main():
# reading excel name from command line arguments
excel_name = sys.argv[1]
# checking if the file exists in current directory, if not, program terminates
if not os.path.exists(excel_name):
sys.exit(f'The excel file {excel_name} doesnt exist')
# reading excel through pandas, skipping one row, so the first part of the cleanup is already done
df = (pd.read_excel(excel_name, skiprows=1).dropna(how='all', axis=1))
# create the writer to write to excel_name_croped.xlsx
writer_croped = pd.ExcelWriter(excel_name.partition('.')[0] + "_croped.xlsx", engine='xlsxwriter')
# removing column W and saving it with the writer:
df.drop(df.columns[22], axis=1, inplace=True)
df.to_excel(writer_croped, index=False, header=True)
writer_croped.close()
if __name__ == '__main__':
main()
Please update cleanup; here is how cleanup should be improved
STEP 1 (see attached code to modify, this is done and working. see code below)
- Row 1 needs to be deleted
- Row V needs to be deleted
STEP2
Examine EACH row one at a time
-examine the RESULTS collumn for each record
-if there is more than one line; duplicate a new record to expand and have 1 row for each
For example; if there is 3 lines of details in "results" then duplicate 3 rows and have the data for each going from 1 row to 3 with RESULTS lines having the one corresponding line
For example; if there is 9 lines of details in "results" then duplicate 9 rows and have the data for each going from 1 row to 9 with results having the one corresponding line
-example.xlsx is updated with 3 records that have multiple lines (at least) and also attached is the existing cleanup
cline1
cline2
cline3
cline4
cline5
cline6
cline7
cline8
cline9
cline10
cline11
cline12
cline13
cline14
is there a way you can see my desktop ?
let me know your thoughts and any questions
While this is hourly; there is a max of $12 that I can pay, as being a cancer patient is tuff and been out of work. Hourly will give you more $ as there is less money taken between us from freelancer
There is hope you can give your “best” price; unemployed, and have cancer with bills backing up, $12 possible? Glowing paragraph of feedback 5 stars
My funds are low but will pay quick and leave 5 stars. Please give your best possible for your bid ? (something reasonable?) Please note there is hope we can mutually complete this task; we can leave each other nice comments and 5 stars for each? Look at feedback on my profile, feedback I left for many others. Here is the project:
SINCERELY WOULD BE NICE TO MEET YOU PLEASE
ANY THOUGHTS ? Please note project is due in two hours as this projects deadline, as this is needed if we can get some done - then we can talk about next steps and 5 stars and another job also. If this is a good one and we are "successful"; would need a couple others setup, but will handle one at a time? Can you do this for something reasonable in a couple hours? 2 hours? thoughts ?
EXISTING CODE
import pandas as pd
import xlsxwriter
import numpy as np
import sys
import os
def main():
# reading excel name from command line arguments
excel_name = sys.argv[1]
# checking if the file exists in current directory, if not, program terminates
if not os.path.exists(excel_name):
sys.exit(f'The excel file {excel_name} doesnt exist')
# reading excel through pandas, skipping one row, so the first part of the cleanup is already done
df = (pd.read_excel(excel_name, skiprows=1).dropna(how='all', axis=1))
# create the writer to write to excel_name_croped.xlsx
writer_croped = pd.ExcelWriter(excel_name.partition('.')[0] + "_croped.xlsx", engine='xlsxwriter')
# removing column W and saving it with the writer:
df.drop(df.columns[22], axis=1, inplace=True)
df.to_excel(writer_croped, index=False, header=True)
writer_croped.close()
if __name__ == '__main__':
main()