Hey everyone. I've got several lists I want to export to excel, but the only thing my script yields is an empty file with no file type. Can anyone point out what element(s) I'm missing to get my lists correctly exported?
data = pd.DataFrame( {'A': [rampdata], 'B' : [vacdropdata], 'C' : [vacdropdata], 'D' : [leakcheckdata], 'E' : [leakcheckdata], 'F' : [runtime4], 'G' : [runtime9], 'H' : [runtime11]} ) excel_file = C:\Users\212601562\Documents\output" sheet_name = "Data set" writer = pd.ExcelWriter(excel_file, engine="xlsxwriter") data.to_excel(writer, sheet_name=sheet_name) workbook = writer.book worksheet = writer.sheets[sheet_name] chart = workbook.add_chart({'type': 'scatter'}) max_rows = len(data) col_x = data.columns.get_loc('A') + 1 col_y = data.columns.get_loc('B') + 1 chart.add_series( { 'name' : "Samples", 'categories' : [sheet_name, 1, col_x, max_rows, col_x], 'values' : [sheet_name, 1, col_y, max_rows, col_y], 'marker' : {'type' : 'circle', 'size' : 4}, 'trendline' : {'type' : 'linear'}, } ) chart.set_x_axis({'name' : 'Concentration'}) chart.set_y_axis({'name': 'Measured', 'major_gridlines':{'visible' : False}}) worksheet.insert_chart('D2', chart) writer.save()
Larz60+ write Oct-04-2021, 08:13 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please use bbcode tags on you posts. This was mentioned in moderator note of your first post.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please use bbcode tags on you posts. This was mentioned in moderator note of your first post.