I/O Classes =========== .. currentmodule:: pandasCore ExcelWriter ----------- Class for writing DataFrame objects to Excel sheets. .. code-block:: python import pandasCore as pd # Write multiple DataFrames to different sheets with pd.ExcelWriter('output.xlsx') as writer: df1.to_excel(writer, sheet_name='Sheet1') df2.to_excel(writer, sheet_name='Sheet2') Parameters ^^^^^^^^^^ .. list-table:: :widths: 20 10 10 60 :header-rows: 1 * - Parameter - Type - Default - Description * - path - str - required - Path to Excel file * - engine - str - None - Write engine ('openpyxl', 'xlsxwriter') * - date_format - str - None - Format for date columns * - datetime_format - str - None - Format for datetime columns * - mode - str - 'w' - Write mode ('w' or 'a') * - if_sheet_exists - str - None - Action if sheet exists Methods ^^^^^^^ .. list-table:: :widths: 25 75 :header-rows: 1 * - Method - Description * - close() - Close and save the file * - save() - Alias for close ExcelFile --------- Class for parsing tabular Excel sheets into DataFrame objects. .. code-block:: python import pandasCore as pd # Read multiple sheets xlsx = pd.ExcelFile('data.xlsx') print(xlsx.sheet_names) # ['Sheet1', 'Sheet2'] df1 = xlsx.parse('Sheet1') df2 = xlsx.parse('Sheet2') Parameters ^^^^^^^^^^ .. list-table:: :widths: 20 10 10 60 :header-rows: 1 * - Parameter - Type - Default - Description * - path - str - required - Path to Excel file * - engine - str - None - Parser engine Methods ^^^^^^^ .. list-table:: :widths: 30 70 :header-rows: 1 * - Method - Description * - parse(sheet_name, ...) - Parse sheet to DataFrame * - close() - Close the file Attributes ^^^^^^^^^^ .. list-table:: :widths: 25 75 :header-rows: 1 * - Attribute - Description * - sheet_names - List of sheet names * - book - Workbook object HDFStore -------- Dict-like interface for storing pandas objects in HDF5 format. .. code-block:: python import pandasCore as pd # Write to HDF5 store = pd.HDFStore('data.h5') store['df'] = df store.close() # Read from HDF5 store = pd.HDFStore('data.h5', mode='r') df = store['df'] store.close() Parameters ^^^^^^^^^^ .. list-table:: :widths: 15 10 10 65 :header-rows: 1 * - Parameter - Type - Default - Description * - path - str - required - Path to HDF5 file * - mode - str - 'a' - File mode ('r', 'w', 'a') * - complevel - int - None - Compression level (0-9) * - complib - str - None - Compression library Methods ^^^^^^^ .. list-table:: :widths: 25 75 :header-rows: 1 * - Method - Description * - put(key, value, ...) - Store object * - get(key) - Retrieve object * - remove(key) - Remove object * - keys() - List of stored keys * - items() - Key/value pairs * - close() - Close the store * - flush() - Flush changes