ReadHospitalData Class#

class ReadHospitalData.readHospitalData#

Bases: object

This class is designed to help wrangle data from the monthly hospital spreadsheets found at

This version of the class will allow you to get regonal data from any worksheet.

join_totals_datasets(directory, ws)#

This will scan the directory open each excel file and join the dataframes for totals for a specific worksheet.

This methods similar to the above one however it will onlt merge data for the selected worksheet.


String Value, this is the directory where the hospital data is.


String Value, this is the worksheet that you want to read.


This will read in totals from all worksheets, takes around 7 seconds for each worksheet it will also merge files from the directory so ensure you just have your hospital data in there!


String Value, the directory that contains hospital data.


A dataframe that contains totals data from all files within the directory and for all worksheets. This function will merge the excel files.


This method is very slow and can take up to 7 seconds per worksheet.

read_in_totals(excel_file, ws)#

This will read the selected owrksheet form a given excel file. Then turn the top of the worksheet into a dataframe, this only reads the totals from each worksheet for ENGLAND and the english regions, it does not read in data for each trust.


String Value, location of the excel file to be used.


String Value, worksheet name within the excel file to read.


A dataframe with all data from the totals part of any given worksheet.