I am pretty new to Pandas and was wondering if there was a way that would let me take the data I want and put it in an xlsx file as a table.
This is what I have so far for my code:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
from openpyxl import load_workbook
#defining the excel file and the sheet(s) and printing them
excel_file_1 = 'Incident Report.xls'
df_first_shift = pd.read_excel(r'C:\Users\M\Downloads\Incident Report.xls')
print(df_first_shift)
#combining all the data from the sheets into one file
df_all = pd.concat([df_first_shift])
#Creating the .xlsx file
df_all.to_excel(r'C:\Users\M\OneDrive\Test\Incident_Report.xlsx')
#Deleting a row
wb = load_workbook(r'C:\Users\M\OneDrive\Test\Incident_Report.xlsx')
ws = wb['Sheet1']
ws.delete_cols(1)
wb.save(r'C:\Users\M\OneDrive\Test\Incident_Report.xlsx')