From eb6b63b42b1ae6136d6822e7e88126e6d092e638 Mon Sep 17 00:00:00 2001 From: Milne Date: Wed, 4 Oct 2023 15:26:46 +0100 Subject: [PATCH 01/28] Comments out Cost of reoffending example --- docs/source/usage.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 253634d2..e9b125cc 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -34,11 +34,11 @@ examples_ directory of the package. :lines: 24- -.. automodule:: gptables.examples.cor_multiple_sheets +.. .. automodule:: gptables.examples.cor_multiple_sheets -.. literalinclude:: ../../gptables/examples/cor_multiple_sheets.py - :language: python - :lines: 16- +.. .. literalinclude:: ../../gptables/examples/cor_multiple_sheets.py +.. :language: python +.. :lines: 16- R Usage From 1936bc5bb090ce9d07a587d8fadc60b4b01ade0e Mon Sep 17 00:00:00 2001 From: Milne Date: Wed, 4 Oct 2023 15:31:14 +0100 Subject: [PATCH 02/28] Creates a minimal penguins example --- gptables/examples/penguins_minimal.py | 62 +++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 gptables/examples/penguins_minimal.py diff --git a/gptables/examples/penguins_minimal.py b/gptables/examples/penguins_minimal.py new file mode 100644 index 00000000..e71e9b51 --- /dev/null +++ b/gptables/examples/penguins_minimal.py @@ -0,0 +1,62 @@ +""" +Iris - Minimal Example +---------------------- + +This example demonstrates use of the ``gptables.write_workbook`` function. +This API function is designed for production of consistently structured and formatted tables. + +Summary statistics from the penguins dataset are used to build a ``gptables.GPTable`` +object. Elements of metadata are provided to the corresponding parameters of the class. +Where you wish to provide no metadata in required parameters, use ``None``. + +Table formatting can be defined as a ``gptable.Theme``, which is passed to the API functions + using the ``theme`` parameter. Or you can reply on our default - gptheme. +""" +import gptables as gpt +import pandas as pd +import numpy as np +from pathlib import Path + +## Read data +parent_dir = Path(__file__).parent + +penguins_data = pd.read_csv(parent_dir / "penguins.csv") + +#Any data processing could go here as long as you end with a Pandas dataframe that you want to write in a spreadsheet + +## Define table elements +penguins_table_name = "penguins_statistics" +penguins_title = "The Penguins Dataset" +penguins_subtitles = [ + "This is the first subtitle", + "Just another subtitle" + ] +penguins_scope = "Penguins" +penguins_source = "Source: Office for Penguin Statistics" + +## Define our GPTable +penguins_table = gpt.GPTable(table=penguins_data, table_name=penguins_table_name, title=penguins_title, subtitles=penguins_subtitles, + scope=penguins_scope, source=penguins_source) + +# or use kwargs to pass these to the appropriate parameters +# kwargs = { +# "table_name": penguins_table_name, +# "title": penguins_title, +# "subtitles": penguins_subtitles, +# "scope": penguins_scope, +# "source": penguins_source, +# } +#penguins_table = gpt.GPTable(table=penguins_data, **kwargs) would also be valid + +#Every table must be associated to a sheet name for writing +penguins_sheets = {"Penguins": penguins_table} + +## Use write_workbook to win! +if __name__ == "__main__": + output_path = parent_dir / "python_penguins_gptable.xlsx" + gpt.write_workbook( + filename=output_path, + sheets=penguins_sheets, + contentsheet_options={"additional_elements": ["subtitles", "scope"]} + ) + print("Output written at: ", output_path) From 27ff89539883bb3160dacf1fbed9bec7754411dd Mon Sep 17 00:00:00 2001 From: Milne Date: Wed, 4 Oct 2023 15:32:04 +0100 Subject: [PATCH 03/28] Creates an example showing how to write a workbook with a cover --- gptables/examples/penguins_cover.py | 73 +++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 gptables/examples/penguins_cover.py diff --git a/gptables/examples/penguins_cover.py b/gptables/examples/penguins_cover.py new file mode 100644 index 00000000..281273f2 --- /dev/null +++ b/gptables/examples/penguins_cover.py @@ -0,0 +1,73 @@ +""" +Iris - Cover Page +----------------- + +This example demonstrates use of the ``gptables.Cover`` class to create a cover page. This example also +demonstrates how to create a workbook with multiple sheets. + +A gptables cover pages contain a range of custom text elements, along with a hyperlinked table of contents. +Text elements are defined as a ``gptables.Cover`` instance, which is passed to the ``cover`` parameter of ``gptables.write_worbook()`` or ``gptables.produce_worbook()``. +In this example, we have also set ``auto_width`` to ``True``. +This automatically determines the width of the first column on the cover sheet, as well as all columns of the tables of the workbook. +""" +import gptables as gpt +import pandas as pd +import numpy as np +from pathlib import Path +from copy import deepcopy + +## Read data +parent_dir = Path(__file__).parent + +penguins_data = pd.read_csv(parent_dir / "penguins.csv") + +#Any data processing could go here as long as you end with a Pandas dataframe that you want to write in a spreadsheet + +## Define table elements +penguins_table_name = "penguins_statistics" +penguins_title = "The Penguins Dataset" +penguins_subtitles = [ + "This is the first subtitle", + "Just another subtitle" + ] +penguins_scope = "Penguins" +penguins_source = "Source: Office for Penguin Statistics" + +# or use kwargs to pass these to the appropriate parameters +kwargs = { + "table_name": penguins_table_name, + "title": penguins_title, + "subtitles": penguins_subtitles, + "scope": penguins_scope, + "source": penguins_source, + } + +## Define our GPTable +penguins_table = gpt.GPTable(table=penguins_data, table_name="penguins_statistics", **kwargs) + +penguins_table_copy = deepcopy(penguins_table) +penguins_table_copy.set_title("A copy of the first sheet") +penguins_table_copy.set_table_name("penguins_statistics_copy") #All tables in a single workbook must have a unique name + +penguins_sheets = { + "Penguins": penguins_table, + "Copy of Penguins": penguins_table_copy +} + +penguins_cover = gpt.Cover( + cover_label="Cover", + title="A Workbook containing two copies of the data", + intro=["This is some introductory information", "And some more"], + about=["Even more info about my data", "And a little more"], + contact=["John Doe", "Tel: 345345345", "Email: [john.doe@snailmail.com](mailto:john.doe@snailmail.com)"], + ) + +## Use write_workbook to win! +if __name__ == "__main__": + output_path = parent_dir / "python_iris_cover_gptable.xlsx" + gpt.write_workbook( + filename=output_path, + sheets=penguins_sheets, + cover=penguins_cover, + ) + print("Output written at: ", output_path) From deb4a6cb57032a39fa485b246ddd481a08690cdd Mon Sep 17 00:00:00 2001 From: Milne Date: Wed, 4 Oct 2023 15:32:33 +0100 Subject: [PATCH 04/28] Creates an example showing how to do notes in gptables --- gptables/examples/penguins_notes.py | 77 +++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 gptables/examples/penguins_notes.py diff --git a/gptables/examples/penguins_notes.py b/gptables/examples/penguins_notes.py new file mode 100644 index 00000000..ed2fb83a --- /dev/null +++ b/gptables/examples/penguins_notes.py @@ -0,0 +1,77 @@ +""" +Penguins - Minimal Example +---------------------- + +This example demonstrates use of the ``gptables.write_workbook`` function. +This API function is designed for production of consistently structured and formatted tables. + +Summary statistics from the penguins dataset are used to build a ``gptables.GPTable`` +object. Elements of metadata are provided to the corresponding parameters of the class. +Where you wish to provide no metadata in required parameters, use ``None``. + +Table formatting can be defined as a ``gptable.Theme``, which is passed to the API functions + using the ``theme`` parameter. Or you can reply on our default - gptheme. +""" +import gptables as gpt +import pandas as pd +import numpy as np +from pathlib import Path + +## Read data +parent_dir = Path(__file__).parent + +penguins_data = pd.read_csv(parent_dir / "penguins.csv") + +#Any data processing could go here as long as you end with a Pandas dataframe that you want to write in a spreadsheet + +## Define table elements + +penguins_table_name = "penguins_statistics" + +#Notes are added by using $$note$$ in text +penguins_title = "The Penguins Dataset$$noteabouty$$" +penguins_subtitles = [ + "This is the first subtitle$$noteaboutx$$", + "Just another subtitle" + ] + +#Notes can also be included in column headers, see below +penguins_table_notes = {"species": "$$noteaboutx$$", 2: "$$noteaboutz$$"} #Columns can be referenced either by index or by name +penguins_units = {2:"mm", "bill_depth_mm":"mm",4:"mm","body_mass_g":"g"} #As above for column referencing +penguins_scope = "Penguins" +penguins_source = "Source: Office for Penguin Statistics" + +kwargs = { + "table_name": penguins_table_name, + "title": penguins_title, + "subtitles": penguins_subtitles, + "units": penguins_units, + "table_notes": penguins_table_notes, + "scope": penguins_scope, + "source": penguins_source, + } + +## Define our GPTable +penguins_table = gpt.GPTable(table=penguins_data, **kwargs) + +penguins_sheets = {"Penguins": penguins_table} + +# Notesheet - Note that the ordering of each list only matters with respect to the other lists in the "notes" dictionary. +# GPTables will use the "Note reference" list to ensure the "Note text" is assigned correctly +notes = { + "Note reference": ["noteaboutz", "noteaboutx", "noteabouty"], + "Note text": ["This is a note about z linking to google.", "This is a note about x linking to duckduckgo.", "This is a note about y linking to the ONS website."], + "Useful link": ["[google](https://www.google.com)", "[duckduckgo](https://duckduckgo.com/)", "[ONS](https://www.ons.gov.uk)"], + } +penguins_notes_table = pd.DataFrame.from_dict(notes) + +## Use write_workbook to win! +if __name__ == "__main__": + output_path = parent_dir / "python_penguins_gptable.xlsx" + gpt.write_workbook( + filename=output_path, + sheets=penguins_sheets, + notes_table=penguins_notes_table, + contentsheet_options={"additional_elements": ["subtitles", "scope"]} + ) + print("Output written at: ", output_path) From 3da569ec895b3ed2e5e255d37de1b0c8d4431011 Mon Sep 17 00:00:00 2001 From: Milne Date: Wed, 4 Oct 2023 15:33:47 +0100 Subject: [PATCH 05/28] Creates an example demonstrating the use of the additional_formatting argument --- .../penguins_additional_formatting.py | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 gptables/examples/penguins_additional_formatting.py diff --git a/gptables/examples/penguins_additional_formatting.py b/gptables/examples/penguins_additional_formatting.py new file mode 100644 index 00000000..343d2d55 --- /dev/null +++ b/gptables/examples/penguins_additional_formatting.py @@ -0,0 +1,105 @@ +""" +Iris - Additional Formatting Example +------------------------------------ + +This example demonstrates additional formatting that is not supported in +the ``gptable.Theme``. + +Specific columns, rows and cells of the table elements (indexes, column headings and data) +can be formatted using the ``gptable.GPTable(..., additional_formatting = ...)`` parameter. +This parameter takes a list of dictionaries, allowing you to select as many rows, columns +or cells as you like. + +As with all formatting, supported arguments are desribed in the +`XlsxWriter documentation `_. + +Any formatting not possible through this means can be achieved using +``XlsxWriter`` `Workbook `_ +and `Worksheet `_ functionality. +A ``gptable.GPWorkbook`` object is returned when using the +``gptables.produce_workbook`` API function. +The ``GPWorkbook.worksheets()`` function returns a list of ``GPWorksheet`` objects, +which can also be modified. +""" + +import gptables as gpt +import pandas as pd +import numpy as np +from pathlib import Path + +## Read data and arrange +parent_dir = Path(__file__).parent + +penguins_data = pd.read_csv(parent_dir / "penguins.csv") + +## Define table elements +penguins_table_name = "penguins_statistics" +penguins_title = "Penguins" + +#Individual words/phrases can have formatting applied without the use of the additional_formatting argument +penguins_subtitles = [ + "1936 Fisher, R.A; The use of multiple measurements in taxonomic problems", + [{"bold": True}, "Just", " another subtitle"] + ] +penguins_units = {key: "cm" for key in range(2,6)} +penguins_scope = "Iris" + +## Define additional formatting +# Columns can be referenced by name or number +# Rows may only be referenced by number +# Column and row numbers refer to the table elements, including indexes and column headings +penguins_additional_formatting = [ + { + "column": { + "columns": ["Species", "Island"], # str, int or list of either + "format": {"align": "center","italic":True}, #The "Species" and "Island" columns are centre-alinged and made italic + } + }, + {"column": {"columns": [3], "format": {"left": 1}}}, #Gives the fourth column a left border + { + "row": { + "rows": -1, # Numbers only, but can refer to last row using -1 + "format": {"bottom": 1, "indentation":2}, # Give the last row a border at the bottom of each cell and indents two levels + } + }, + ] + +# or just use kwargs +kwargs = { + "table_name": penguins_table_name, + "title": penguins_title, + "subtitles": penguins_subtitles, + "units": penguins_units, + "scope": penguins_scope, + "source": None, + "additional_formatting": penguins_additional_formatting, + } + +## Define our GPTable +penguins_table = gpt.GPTable(table=penguins_data, **kwargs) + +## Use produce workbook to return GPWorkbook +if __name__ == "__main__": + output_path = parent_dir / "python_penguins_additional_formatting_gptable.xlsx" + wb = gpt.produce_workbook( + filename=output_path, sheets={"Penguins": penguins_table} + ) + + # Carry out additional modifications on the GPWorkbook or GPWorksheets + # This supports all `XlsxWriter` package functionality + ws = wb.worksheets()[0] + ws.set_row(0, 30) # Set the height of the first row + + # Finally use the close method to save the output + + #To format cells using the set_row function we must use a workbook to create a format object + italic_format=wb.add_format({"italic":True}) + ws.set_column(2,3,10,italic_format) #Sets the width of the third and fourth column and makes them italic + + #Note that the first two arguments of set_column are the first and last columns (inclusive) you want to format as opposed + #to set_row which only affects a single row at a time (the first argument). + + wb.close() + print("Output written at: ", output_path) + + From 0614b17deec831932c6543a67e57196a8e009a1c Mon Sep 17 00:00:00 2001 From: Milne Date: Wed, 4 Oct 2023 15:34:07 +0100 Subject: [PATCH 06/28] Removes old iris examples --- .../examples/iris_additional_formatting.py | 126 ------------------ gptables/examples/iris_cover.py | 93 ------------- 2 files changed, 219 deletions(-) delete mode 100644 gptables/examples/iris_additional_formatting.py delete mode 100644 gptables/examples/iris_cover.py diff --git a/gptables/examples/iris_additional_formatting.py b/gptables/examples/iris_additional_formatting.py deleted file mode 100644 index 411c05d1..00000000 --- a/gptables/examples/iris_additional_formatting.py +++ /dev/null @@ -1,126 +0,0 @@ -""" -Iris - Additional Formatting Example ------------------------------------- - -This example demonstrates additional formatting that is not supported in -the ``gptable.Theme``. - -Specific columns, rows and cells of the table elements (indexes, column headings and data) -can be formatted using the ``gptable.GPTable(..., additional_formatting = ...)`` parameter. -This parameter takes a list of dictionaries, allowing you to select as many rows, columns -or cells as you like. - -As with all formatting, supported arguments are desribed in the -`XlsxWriter documentation `_. - -Any formatting not possibly through this means can be achieved using -``XlsxWriter`` `Workbook `_ -and `Worksheet `_ functionality. -A ``gptable.GPWorkbook`` object is returned when using the -``gptables.produce_workbook`` API function. -The ``GPWorkbook.worksheets()`` function returns a list of ``GPWorksheet`` objects, -which can also be modified. -""" - -import gptables as gpt -import pandas as pd -import numpy as np -from pathlib import Path - -## Read data and arrange -parent_dir = Path(__file__).parent - -iris_data = pd.read_csv(parent_dir / "iris.csv") - -iris_data.rename( - columns={ - "class": "class", - "sepal_length": "Sepal Length", - "petal_length": "Petal Length", - "petal_width": "Petal Width", - "sepal_width": "Sepal Width", - }, - inplace=True, - ) - -iris_data["class"] = iris_data.apply(lambda row: row["class"][5:].capitalize(), axis=1) - -# Calculate summaries -subtables = [] -funcs = [np.mean, np.median] -for func in funcs: - subtables.append(iris_data.groupby("class").agg(func)) - subtables.append(pd.DataFrame(iris_data.iloc[:,0:4].agg(func).rename("All")).T) -iris_summary = pd.concat(subtables) -iris_summary["Average"] = ["Mean"] * 4 + ["Median"] * 4 - -# Reshape -iris_summary = iris_summary.reset_index() -iris_summary = iris_summary.melt(["index", "Average"], var_name="Iris feature") -iris_summary = iris_summary.pivot_table( - index=["Iris feature", "Average"], columns="index", values="value" - ).reset_index() - -## Define table elements -table_name = "iris_statistics" -title = "Iris flower dimensions" -subtitles = [ - "1936 Fisher, R.A; The use of multiple measurements in taxonomic problems", - [{"bold": True}, "Just", " another subtitle"] - ] -units = {key: "cm" for key in range(2,6)} -scope = "Iris" -index = {1: 0, 2: 1} - -## Define additional formatting -# Columns can be references by name or number -# Rows may only be referenced by number -# Column and row numbers refer to the table elements, including indexes and column headings -additional_formatting = [ - { - "column": { - "columns": ["Setosa", "Versicolor"], # str, int or list of either - "format": {"align": "center"}, - } - }, - {"column": {"columns": [3], "format": {"left": 1}}}, - { - "row": { - "rows": -1, # Numbers only, but can refer to last row using -1 - "format": {"bottom": 1}, # Underline row - } - }, - ] - -# or just use kwargs -kwargs = { - "table_name": table_name, - "title": title, - "subtitles": subtitles, - "units": units, - "scope": scope, - "source": None, - "index_columns": index, - "additional_formatting": additional_formatting, - } - -## Define our GPTable -iris_table = gpt.GPTable(table=iris_summary, **kwargs) - -## Use produce workbook to return GPWorkbook -if __name__ == "__main__": - output_path = parent_dir / "python_iris_additional_formatting_gptable.xlsx" - wb = gpt.produce_workbook( - filename=output_path, sheets={"Iris Flower Dimensions": iris_table} - ) - - # Carry out additional modifications on the GPWorkbook or GPWorksheets - # This supports all `XlsxWriter` package functionality - ws = wb.worksheets()[0] - ws.set_row(0, 30) # Set the height of the first row - - # Finally use the close method to save the output - wb.close() - print("Output written at: ", output_path) - - diff --git a/gptables/examples/iris_cover.py b/gptables/examples/iris_cover.py deleted file mode 100644 index 94345a16..00000000 --- a/gptables/examples/iris_cover.py +++ /dev/null @@ -1,93 +0,0 @@ -""" -Iris - Cover Page ------------------ - -This example demonstrates use of the ``gptables.Cover`` class to create a cover page. - -A gptables cover pages contain a range of custom text elements, along with a hyperlinked table of contents. -Text elements are defined as a ``gptables.Cover`` instance, which is passed to the ``cover`` parameter of ``gptables.write_worbook()`` or ``gptables.produce_worbook()``. -In this example, we have also set ``auto_width`` to ``True``. -This automatically determines the width of the first column on the cover sheet, as well as all columns of the tables of the workbook. -""" -import gptables as gpt -import pandas as pd -import numpy as np -from pathlib import Path -from copy import deepcopy - -## Read data and arrange -parent_dir = Path(__file__).parent - -iris_data = pd.read_csv(parent_dir / "iris.csv") -iris_data = iris_data.loc[:, ["class", "sepal_length", "sepal_width"]] - -iris_summary = iris_data.groupby("class").agg(np.mean) -iris_summary.index = [_[5:].capitalize() for _ in iris_summary.index] -iris_summary.reset_index(inplace=True) -iris_summary.rename( - columns={ - "index": "Class", - "sepal_length": "Mean Sepal Length", - "sepal_width": "Mean Sepal Width", - }, - inplace=True, -) - -## Define table elements -title = "Mean Iris$$note2$$ sepal dimensions" -subtitles = [ - "1936 Fisher, R.A; The use of multiple measurements in taxonomic problems$$note1$$", - "Just another subtitle", - ] -units = {"Mean Sepal Length": "cm", "Mean Sepal Width": "cm"} -scope = "Iris" -source = "Source: Office for Iris Statistics" -index = {2: 0} # Column 0 is a level 2 index - -# or use kwargs to pass these to the appropriate parameters -kwargs = { - "title": title, - "subtitles": subtitles, - "units": units, - "scope": scope, - "source": source, - "index_columns": index, - } - -## Define our GPTable -iris_table = gpt.GPTable(table=iris_summary, table_name="iris_statistics", **kwargs) - -iris_table_copy = deepcopy(iris_table) -iris_table_copy.set_title("A copy of the first sheet$$note3$$") -iris_table_copy.set_table_name("iris_statistics_copy") - -sheets = { - "Iris Flower Dimensions": iris_table, - "Copy of Iris Flower Dimensions": iris_table_copy -} - -cover = gpt.Cover( - cover_label="Cover", - title="A Workbook containing good practice tables", - intro=["This is some introductory information", "And some more"], - about=["Even more info about my data", "And a little more"], - contact=["John Doe", "Tel: 345345345", "Email: [john.doe@snailmail.com](mailto:john.doe@snailmail.com)"], - ) - -## Notesheet -notes = { - "Note reference": ["note1", "note2", "note3"], - "Note text": ["I've got 99 problems and taxonomy is one.", "Goo Goo Dolls, 1998.", "This is an extra note"], - } -notes_table = pd.DataFrame.from_dict(notes) - -## Use write_workbook to win! -if __name__ == "__main__": - output_path = parent_dir / "python_iris_cover_gptable.xlsx" - gpt.write_workbook( - filename=output_path, - sheets=sheets, - cover=cover, - notes_table=notes_table - ) - print("Output written at: ", output_path) From f0ed2f144e301af751afd6df858b976fadd07aeb Mon Sep 17 00:00:00 2001 From: Milne Date: Wed, 4 Oct 2023 15:37:26 +0100 Subject: [PATCH 07/28] Changes docs to display new examples --- docs/source/usage.rst | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/source/usage.rst b/docs/source/usage.rst index e9b125cc..5e3c246b 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -13,26 +13,29 @@ examples_ directory of the package. .. todo:: Replace datasets in examples with open online datasets -.. automodule:: gptables.examples.iris +.. automodule:: gptables.examples.penguins_minimal -.. literalinclude:: ../../gptables/examples/iris.py +.. literalinclude:: ../../gptables/examples/penguins_minimal.py :language: python :lines: 15- +.. automodule:: gptables.examples.penguins_cover -.. automodule:: gptables.examples.iris_cover - -.. literalinclude:: ../../gptables/examples/iris_cover.py +.. literalinclude:: ../../gptables/examples/penguins_cover.py :language: python :lines: 12- +.. automodule:: gptables.examples.penguins_notes -.. automodule:: gptables.examples.iris_additional_formatting - -.. literalinclude:: ../../gptables/examples/iris_additional_formatting.py +.. literalinclude:: ../../gptables/examples/penguins_notes.py :language: python :lines: 24- +.. automodule:: gptables.examples.penguins_additional_formatting + +.. literalinclude:: ../../gptables/examples/penguins_additional_formatting.py + :language: python + :lines: 24- .. .. automodule:: gptables.examples.cor_multiple_sheets From 5959027f82e2d132d7396b6b3ad28a0d370589cb Mon Sep 17 00:00:00 2001 From: Milne Date: Wed, 4 Oct 2023 15:39:23 +0100 Subject: [PATCH 08/28] Fixes example headers --- gptables/examples/penguins_additional_formatting.py | 2 +- gptables/examples/penguins_cover.py | 2 +- gptables/examples/penguins_minimal.py | 2 +- gptables/examples/penguins_notes.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gptables/examples/penguins_additional_formatting.py b/gptables/examples/penguins_additional_formatting.py index 343d2d55..561963ee 100644 --- a/gptables/examples/penguins_additional_formatting.py +++ b/gptables/examples/penguins_additional_formatting.py @@ -1,5 +1,5 @@ """ -Iris - Additional Formatting Example +Penguins - Additional Formatting Example ------------------------------------ This example demonstrates additional formatting that is not supported in diff --git a/gptables/examples/penguins_cover.py b/gptables/examples/penguins_cover.py index 281273f2..499ce7e0 100644 --- a/gptables/examples/penguins_cover.py +++ b/gptables/examples/penguins_cover.py @@ -1,5 +1,5 @@ """ -Iris - Cover Page +Penguins - Cover Page ----------------- This example demonstrates use of the ``gptables.Cover`` class to create a cover page. This example also diff --git a/gptables/examples/penguins_minimal.py b/gptables/examples/penguins_minimal.py index e71e9b51..1f5aa385 100644 --- a/gptables/examples/penguins_minimal.py +++ b/gptables/examples/penguins_minimal.py @@ -1,5 +1,5 @@ """ -Iris - Minimal Example +Penguins - Minimal Example ---------------------- This example demonstrates use of the ``gptables.write_workbook`` function. diff --git a/gptables/examples/penguins_notes.py b/gptables/examples/penguins_notes.py index ed2fb83a..8b654221 100644 --- a/gptables/examples/penguins_notes.py +++ b/gptables/examples/penguins_notes.py @@ -1,5 +1,5 @@ """ -Penguins - Minimal Example +Penguins - Notes Example ---------------------- This example demonstrates use of the ``gptables.write_workbook`` function. From e1c2442b0f6672a4b5de5f5dfe7be6e8ec2db74d Mon Sep 17 00:00:00 2001 From: Milne Date: Wed, 4 Oct 2023 16:16:26 +0100 Subject: [PATCH 09/28] Relaces iris theme example with penguins theme example --- gptables/examples/iris_personal_theme.py | 89 ------------------------ gptables/examples/penguins_theme.py | 64 +++++++++++++++++ 2 files changed, 64 insertions(+), 89 deletions(-) delete mode 100644 gptables/examples/iris_personal_theme.py create mode 100644 gptables/examples/penguins_theme.py diff --git a/gptables/examples/iris_personal_theme.py b/gptables/examples/iris_personal_theme.py deleted file mode 100644 index c0795fcb..00000000 --- a/gptables/examples/iris_personal_theme.py +++ /dev/null @@ -1,89 +0,0 @@ -""" -Iris - Minimal Example ----------------------- - -This example demonstrates use of the ``gptables.write_workbook`` function and how to add a personalised theme. -This API function is designed for production of consistently structured and formatted tables. - -Summary statistics from the classic iris dataset are used to build a ``gptables.GPTable`` -object. Elements of metadata are provided to the corresponding parameters of the class. -Where you wish to provide no metadata in required parameters, use ``None``. - -Table formatting can be defined as a ``gptable.Theme``, which is passed to the API functions - using the ``theme`` parameter. Or you can reply on our default - gptheme. - - The theme parameter must take either a directory or a yaml file in the ``gptables.write_workbook`` function. The yaml file used in this example can be found in the themes folder as ''iris_test_theme.yaml''. - The personalised theme removes any bold or italics from the table. -""" -import gptables as gpt -import pandas as pd -import numpy as np -from pathlib import Path - -## Read data and arrange -parent_dir = Path(__file__).parent - -iris_data = pd.read_csv(parent_dir / "iris.csv") -iris_data = iris_data.loc[:, ["class", "sepal_length", "sepal_width"]] - -iris_summary = iris_data.groupby("class").agg(np.mean) -iris_summary.index = [_[5:].capitalize() for _ in iris_summary.index] -iris_summary.reset_index(inplace=True) -iris_summary.rename( - columns={ - "index": "Class", - "sepal_length": "Mean Sepal Length", - "sepal_width": "Mean Sepal Width", - }, - inplace=True, - ) - -## Define table elements -table_name = "iris_statistics" -title = "Mean Iris$$note2$$ sepal dimensions" -subtitles = [ - "1936 Fisher, R.A; The use of multiple measurements in taxonomic problems$$note1$$", - "Just another subtitle", - ] -units = {1:"cm", 2:"cm"} -scope = "Iris" -source = "Source: Office for Iris Statistics" -index = {2: 0} # Column 0 is a level 2 index - -# or use kwargs to pass these to the appropriate parameters -kwargs = { - "table_name": table_name, - "title": title, - "subtitles": subtitles, - "units": units, - "scope": scope, - "source": source, - "index_columns": index - } - -## Define our GPTable -iris_table = gpt.GPTable(table=iris_summary, **kwargs) - -sheets = {"Iris Flower Dimensions": iris_table} - -## Notesheet -notes = { - "Note reference": ["note1", "note2"], - "Note text": ["I've got 99 problems and taxonomy is one.", - "Goo Goo Dolls, 1998."], - "Useful link": ["[google](https://www.google.com)", "[duckduckgo](https://duckduckgo.com/)"], - } -notes_table = pd.DataFrame.from_dict(notes) - -## Use write_workbook to win! -if __name__ == "__main__": - output_path = parent_dir / "python_iris_theme_gptable.xlsx" - theme_path = str(Path(__file__).parent.parent / "themes/iris_test_theme.yaml") - gpt.write_workbook( - filename=output_path, - sheets={"Iris Flower Dimensions": iris_table}, - theme = gpt.Theme(theme_path), - notes_table=notes_table, - contentsheet_options={"additional_elements": ["subtitles", "scope"]} - ) - print("Output written at: ", output_path) diff --git a/gptables/examples/penguins_theme.py b/gptables/examples/penguins_theme.py new file mode 100644 index 00000000..47618a32 --- /dev/null +++ b/gptables/examples/penguins_theme.py @@ -0,0 +1,64 @@ +""" +Penguins - Theme Example +---------------------- + +This example demonstrates how to use a custom theme in the production of a workbook. + +Summary statistics from the penguins dataset are used to build a ``gptables.GPTable`` +object. Elements of metadata are provided to the corresponding parameters of the class. +Where you wish to provide no metadata in required parameters, use ``None``. + +Table formatting can be defined as a ``gptable.Theme``, which is passed to the API functions + using the ``theme`` parameter. Or you can reply on our default - gptheme. +""" +import gptables as gpt +import pandas as pd +import numpy as np +from pathlib import Path + +## Read data +parent_dir = Path(__file__).parent + +penguins_data = pd.read_csv(parent_dir / "penguins.csv") + +#Any data processing could go here as long as you end with a Pandas dataframe that you want to write in a spreadsheet + +## Define table elements +penguins_table_name = "penguins_statistics" +penguins_title = "The Penguins Dataset" +penguins_subtitles = [ + "This is the first subtitle", + "Just another subtitle" + ] +penguins_scope = "Penguins" +penguins_source = "Source: Office for Penguin Statistics" + +## Define our GPTable +penguins_table = gpt.GPTable(table=penguins_data, table_name=penguins_table_name, title=penguins_title, subtitles=penguins_subtitles, + scope=penguins_scope, source=penguins_source) + +# or use kwargs to pass these to the appropriate parameters +# kwargs = { +# "table_name": penguins_table_name, +# "title": penguins_title, +# "subtitles": penguins_subtitles, +# "scope": penguins_scope, +# "source": penguins_source, +# } +#penguins_table = gpt.GPTable(table=penguins_data, **kwargs) would also be valid + +#Every table must be associated to a sheet name for writing +penguins_sheets = {"Penguins": penguins_table} + +## Use write_workbook to win! +# Simply pass the filepath of the yaml file containing your theme to the GPTables Theme class and then to write_workbook +if __name__ == "__main__": + output_path = parent_dir / "python_penguins_gptable.xlsx" + theme_path = str(Path(__file__).parent.parent / "themes/penguins_test_theme.yaml") + gpt.write_workbook( + filename=output_path, + sheets=penguins_sheets, + theme = gpt.Theme(theme_path), + contentsheet_options={"additional_elements": ["subtitles", "scope"]} + ) + print("Output written at: ", output_path) From 25a3016651b53afda7cfacb4998bdda8ca984a41 Mon Sep 17 00:00:00 2001 From: Milne Date: Wed, 4 Oct 2023 16:17:18 +0100 Subject: [PATCH 10/28] Fixes theme example header --- gptables/examples/penguins_theme.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gptables/examples/penguins_theme.py b/gptables/examples/penguins_theme.py index 47618a32..04a85d61 100644 --- a/gptables/examples/penguins_theme.py +++ b/gptables/examples/penguins_theme.py @@ -8,8 +8,8 @@ object. Elements of metadata are provided to the corresponding parameters of the class. Where you wish to provide no metadata in required parameters, use ``None``. -Table formatting can be defined as a ``gptable.Theme``, which is passed to the API functions - using the ``theme`` parameter. Or you can reply on our default - gptheme. +- The theme parameter must take either a directory or a yaml file in the ``gptables.write_workbook`` function. The yaml file used in this example can be found in the themes folder as ''penguins_test_theme.yaml''. +- The personalised theme removes any bold or italics from the table. """ import gptables as gpt import pandas as pd From e3ddf080898c4f4f8434d42c0f028197c70056ce Mon Sep 17 00:00:00 2001 From: Milne Date: Wed, 4 Oct 2023 16:22:14 +0100 Subject: [PATCH 11/28] Renames iris theme to penguins --- .../themes/{iris_test_theme.yaml => penguins_test_theme.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename gptables/themes/{iris_test_theme.yaml => penguins_test_theme.yaml} (100%) diff --git a/gptables/themes/iris_test_theme.yaml b/gptables/themes/penguins_test_theme.yaml similarity index 100% rename from gptables/themes/iris_test_theme.yaml rename to gptables/themes/penguins_test_theme.yaml From 616885341525f6ced3f300b19cbeea016f49d52b Mon Sep 17 00:00:00 2001 From: Milne Date: Mon, 16 Oct 2023 15:00:55 +0100 Subject: [PATCH 12/28] Fixes typos in minimal example --- gptables/examples/penguins_minimal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gptables/examples/penguins_minimal.py b/gptables/examples/penguins_minimal.py index 1f5aa385..e240d907 100644 --- a/gptables/examples/penguins_minimal.py +++ b/gptables/examples/penguins_minimal.py @@ -10,7 +10,7 @@ Where you wish to provide no metadata in required parameters, use ``None``. Table formatting can be defined as a ``gptable.Theme``, which is passed to the API functions - using the ``theme`` parameter. Or you can reply on our default - gptheme. +using the ``theme`` parameter. Or you can rely on our default - gptheme. """ import gptables as gpt import pandas as pd From 45af7c03fbe0bd818a1609947cfa6d6dbfec9406 Mon Sep 17 00:00:00 2001 From: Milne Date: Mon, 16 Oct 2023 15:02:43 +0100 Subject: [PATCH 13/28] Fixes typos in cover example --- gptables/examples/penguins_cover.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gptables/examples/penguins_cover.py b/gptables/examples/penguins_cover.py index 499ce7e0..894b5dfb 100644 --- a/gptables/examples/penguins_cover.py +++ b/gptables/examples/penguins_cover.py @@ -5,7 +5,7 @@ This example demonstrates use of the ``gptables.Cover`` class to create a cover page. This example also demonstrates how to create a workbook with multiple sheets. -A gptables cover pages contain a range of custom text elements, along with a hyperlinked table of contents. +A gptables cover page contains a range of custom text elements, along with a hyperlinked table of contents. Text elements are defined as a ``gptables.Cover`` instance, which is passed to the ``cover`` parameter of ``gptables.write_worbook()`` or ``gptables.produce_worbook()``. In this example, we have also set ``auto_width`` to ``True``. This automatically determines the width of the first column on the cover sheet, as well as all columns of the tables of the workbook. @@ -64,7 +64,7 @@ ## Use write_workbook to win! if __name__ == "__main__": - output_path = parent_dir / "python_iris_cover_gptable.xlsx" + output_path = parent_dir / "python_penguins_cover_gptable.xlsx" gpt.write_workbook( filename=output_path, sheets=penguins_sheets, From 546ccfd531d9a3d26b295283114433bd20ea8b4d Mon Sep 17 00:00:00 2001 From: Milne Date: Mon, 16 Oct 2023 15:09:24 +0100 Subject: [PATCH 14/28] Rewrites header for notes example --- gptables/examples/penguins_cover.py | 1 - gptables/examples/penguins_notes.py | 15 +++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/gptables/examples/penguins_cover.py b/gptables/examples/penguins_cover.py index 894b5dfb..83e6da1e 100644 --- a/gptables/examples/penguins_cover.py +++ b/gptables/examples/penguins_cover.py @@ -33,7 +33,6 @@ penguins_scope = "Penguins" penguins_source = "Source: Office for Penguin Statistics" -# or use kwargs to pass these to the appropriate parameters kwargs = { "table_name": penguins_table_name, "title": penguins_title, diff --git a/gptables/examples/penguins_notes.py b/gptables/examples/penguins_notes.py index 8b654221..b199799c 100644 --- a/gptables/examples/penguins_notes.py +++ b/gptables/examples/penguins_notes.py @@ -2,15 +2,14 @@ Penguins - Notes Example ---------------------- -This example demonstrates use of the ``gptables.write_workbook`` function. -This API function is designed for production of consistently structured and formatted tables. +This example demonstrates how to include notes in a GPTable. Notes cannot +be included in data cells but may appear either in column headers or in text such +as titles, subtitles, etc. -Summary statistics from the penguins dataset are used to build a ``gptables.GPTable`` -object. Elements of metadata are provided to the corresponding parameters of the class. -Where you wish to provide no metadata in required parameters, use ``None``. - -Table formatting can be defined as a ``gptable.Theme``, which is passed to the API functions - using the ``theme`` parameter. Or you can reply on our default - gptheme. +Placeholders for notes are put in using the notation, $$note$$. The actual note text +must be provided as a Pandas dataframe to the notes_table argument of the ``gptables.write_workbook`` function. +This dataframe should contain the text of the placeholder, the actual text you want in the note and (optionally) +any hyperlinks you want in the note. """ import gptables as gpt import pandas as pd From 8f7b2c6e0ba5a646f2b0caad69dadf2e45d1e528 Mon Sep 17 00:00:00 2001 From: Milne Date: Mon, 16 Oct 2023 15:28:38 +0100 Subject: [PATCH 15/28] Tidies up the theme example --- gptables/examples/penguins_theme.py | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/gptables/examples/penguins_theme.py b/gptables/examples/penguins_theme.py index 04a85d61..74d410bc 100644 --- a/gptables/examples/penguins_theme.py +++ b/gptables/examples/penguins_theme.py @@ -8,8 +8,9 @@ object. Elements of metadata are provided to the corresponding parameters of the class. Where you wish to provide no metadata in required parameters, use ``None``. -- The theme parameter must take either a directory or a yaml file in the ``gptables.write_workbook`` function. The yaml file used in this example can be found in the themes folder as ''penguins_test_theme.yaml''. -- The personalised theme removes any bold or italics from the table. +The theme parameter must take either a directory or a yaml file in the ``gptables.write_workbook`` function. +The yaml file used in this example can be found in the themes folder as ''penguins_test_theme.yaml''. +The personalised theme removes any bold or italics from the table. """ import gptables as gpt import pandas as pd @@ -33,21 +34,15 @@ penguins_scope = "Penguins" penguins_source = "Source: Office for Penguin Statistics" -## Define our GPTable -penguins_table = gpt.GPTable(table=penguins_data, table_name=penguins_table_name, title=penguins_title, subtitles=penguins_subtitles, - scope=penguins_scope, source=penguins_source) +kwargs = { + "table_name": penguins_table_name, + "title": penguins_title, + "subtitles": penguins_subtitles, + "scope": penguins_scope, + "source": penguins_source, + } +penguins_table = gpt.GPTable(table=penguins_data, **kwargs) -# or use kwargs to pass these to the appropriate parameters -# kwargs = { -# "table_name": penguins_table_name, -# "title": penguins_title, -# "subtitles": penguins_subtitles, -# "scope": penguins_scope, -# "source": penguins_source, -# } -#penguins_table = gpt.GPTable(table=penguins_data, **kwargs) would also be valid - -#Every table must be associated to a sheet name for writing penguins_sheets = {"Penguins": penguins_table} ## Use write_workbook to win! From 0e315aff48b147f0d0be284227227a6e6bd2c1f4 Mon Sep 17 00:00:00 2001 From: Milne Date: Mon, 16 Oct 2023 15:39:34 +0100 Subject: [PATCH 16/28] Fixes typos in additional_formatting example --- .../examples/penguins_additional_formatting.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gptables/examples/penguins_additional_formatting.py b/gptables/examples/penguins_additional_formatting.py index 561963ee..6bd76b25 100644 --- a/gptables/examples/penguins_additional_formatting.py +++ b/gptables/examples/penguins_additional_formatting.py @@ -32,17 +32,19 @@ penguins_data = pd.read_csv(parent_dir / "penguins.csv") +#Any data processing could go here as long as you end with a Pandas dataframe that you want to write in a spreadsheet + ## Define table elements penguins_table_name = "penguins_statistics" penguins_title = "Penguins" #Individual words/phrases can have formatting applied without the use of the additional_formatting argument penguins_subtitles = [ - "1936 Fisher, R.A; The use of multiple measurements in taxonomic problems", + "The first subtitle", [{"bold": True}, "Just", " another subtitle"] ] -penguins_units = {key: "cm" for key in range(2,6)} -penguins_scope = "Iris" +penguins_units = {key: "mm" for key in range(2,5)} +penguins_scope = "Penguins" ## Define additional formatting # Columns can be referenced by name or number @@ -52,7 +54,7 @@ { "column": { "columns": ["Species", "Island"], # str, int or list of either - "format": {"align": "center","italic":True}, #The "Species" and "Island" columns are centre-alinged and made italic + "format": {"align": "center","italic":True}, #The "Species" and "Island" columns are centre-aligned and made italic } }, {"column": {"columns": [3], "format": {"left": 1}}}, #Gives the fourth column a left border @@ -64,7 +66,6 @@ }, ] -# or just use kwargs kwargs = { "table_name": penguins_table_name, "title": penguins_title, @@ -90,14 +91,14 @@ ws = wb.worksheets()[0] ws.set_row(0, 30) # Set the height of the first row - # Finally use the close method to save the output - - #To format cells using the set_row function we must use a workbook to create a format object + #To format cells using the set_row or set_column functions we must use a workbook to create a format object italic_format=wb.add_format({"italic":True}) ws.set_column(2,3,10,italic_format) #Sets the width of the third and fourth column and makes them italic #Note that the first two arguments of set_column are the first and last columns (inclusive) you want to format as opposed #to set_row which only affects a single row at a time (the first argument). + + # Finally use the close method to save the output wb.close() print("Output written at: ", output_path) From b018a702d3219f0dcf596be64e2b4dc8a0c9f8d8 Mon Sep 17 00:00:00 2001 From: Milne Date: Mon, 16 Oct 2023 15:50:40 +0100 Subject: [PATCH 17/28] Fixes display lines for examples --- docs/source/usage.rst | 14 ++++++++++---- gptables/examples/penguins_cover.py | 1 + gptables/examples/penguins_minimal.py | 1 + gptables/examples/penguins_notes.py | 1 + gptables/examples/penguins_theme.py | 1 + 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 5e3c246b..ba35bc49 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -17,25 +17,31 @@ examples_ directory of the package. .. literalinclude:: ../../gptables/examples/penguins_minimal.py :language: python - :lines: 15- + :lines: 16- + +.. automodule:: gptables.examples.penguins_theme + +.. literalinclude:: ../../gptables/examples/penguins_theme.py + :language: python + :lines: 16- .. automodule:: gptables.examples.penguins_cover .. literalinclude:: ../../gptables/examples/penguins_cover.py :language: python - :lines: 12- + :lines: 14- .. automodule:: gptables.examples.penguins_notes .. literalinclude:: ../../gptables/examples/penguins_notes.py :language: python - :lines: 24- + :lines: 15- .. automodule:: gptables.examples.penguins_additional_formatting .. literalinclude:: ../../gptables/examples/penguins_additional_formatting.py :language: python - :lines: 24- + :lines: 25- .. .. automodule:: gptables.examples.cor_multiple_sheets diff --git a/gptables/examples/penguins_cover.py b/gptables/examples/penguins_cover.py index 83e6da1e..cb8744ff 100644 --- a/gptables/examples/penguins_cover.py +++ b/gptables/examples/penguins_cover.py @@ -10,6 +10,7 @@ In this example, we have also set ``auto_width`` to ``True``. This automatically determines the width of the first column on the cover sheet, as well as all columns of the tables of the workbook. """ + import gptables as gpt import pandas as pd import numpy as np diff --git a/gptables/examples/penguins_minimal.py b/gptables/examples/penguins_minimal.py index e240d907..f879ca44 100644 --- a/gptables/examples/penguins_minimal.py +++ b/gptables/examples/penguins_minimal.py @@ -12,6 +12,7 @@ Table formatting can be defined as a ``gptable.Theme``, which is passed to the API functions using the ``theme`` parameter. Or you can rely on our default - gptheme. """ + import gptables as gpt import pandas as pd import numpy as np diff --git a/gptables/examples/penguins_notes.py b/gptables/examples/penguins_notes.py index b199799c..fc76af35 100644 --- a/gptables/examples/penguins_notes.py +++ b/gptables/examples/penguins_notes.py @@ -11,6 +11,7 @@ This dataframe should contain the text of the placeholder, the actual text you want in the note and (optionally) any hyperlinks you want in the note. """ + import gptables as gpt import pandas as pd import numpy as np diff --git a/gptables/examples/penguins_theme.py b/gptables/examples/penguins_theme.py index 74d410bc..48ff5e06 100644 --- a/gptables/examples/penguins_theme.py +++ b/gptables/examples/penguins_theme.py @@ -12,6 +12,7 @@ The yaml file used in this example can be found in the themes folder as ''penguins_test_theme.yaml''. The personalised theme removes any bold or italics from the table. """ + import gptables as gpt import pandas as pd import numpy as np From 959ca26a512f6d1e5f8369b49e995e728188a5d3 Mon Sep 17 00:00:00 2001 From: Milne Date: Mon, 16 Oct 2023 16:13:02 +0100 Subject: [PATCH 18/28] Adds index_columns to cover example --- gptables/examples/penguins_cover.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gptables/examples/penguins_cover.py b/gptables/examples/penguins_cover.py index cb8744ff..f03587f9 100644 --- a/gptables/examples/penguins_cover.py +++ b/gptables/examples/penguins_cover.py @@ -3,10 +3,10 @@ ----------------- This example demonstrates use of the ``gptables.Cover`` class to create a cover page. This example also -demonstrates how to create a workbook with multiple sheets. +demonstrates the usage of the ``index_columns`` argument and how to create a workbook with multiple sheets. A gptables cover page contains a range of custom text elements, along with a hyperlinked table of contents. -Text elements are defined as a ``gptables.Cover`` instance, which is passed to the ``cover`` parameter of ``gptables.write_worbook()`` or ``gptables.produce_worbook()``. +Text elements are defined as a ``gptables.Cover`` instance, which is passed to the ``cover`` parameter of ``gptables.write_workbook()`` or ``gptables.produce_workbook()``. In this example, we have also set ``auto_width`` to ``True``. This automatically determines the width of the first column on the cover sheet, as well as all columns of the tables of the workbook. """ @@ -40,6 +40,7 @@ "subtitles": penguins_subtitles, "scope": penguins_scope, "source": penguins_source, + "index_columns": {2: 0} # The level 2 index from our Pandas dataframe is put in the first (zeroth with Python indexing) column of the spreadsheet } ## Define our GPTable From 634c7f79c76d0b910125bcb67ad2d6af1f731b11 Mon Sep 17 00:00:00 2001 From: Milne Date: Fri, 28 Jun 2024 14:43:50 +0100 Subject: [PATCH 19/28] Provides source for penguins dataset --- gptables/examples/penguins_cover.py | 2 +- gptables/examples/penguins_minimal.py | 2 +- gptables/examples/penguins_notes.py | 2 +- gptables/examples/penguins_theme.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gptables/examples/penguins_cover.py b/gptables/examples/penguins_cover.py index f03587f9..4b982cc4 100644 --- a/gptables/examples/penguins_cover.py +++ b/gptables/examples/penguins_cover.py @@ -32,7 +32,7 @@ "Just another subtitle" ] penguins_scope = "Penguins" -penguins_source = "Source: Office for Penguin Statistics" +penguins_source = "Palmer Station, Antarctica" kwargs = { "table_name": penguins_table_name, diff --git a/gptables/examples/penguins_minimal.py b/gptables/examples/penguins_minimal.py index f879ca44..89a4aff8 100644 --- a/gptables/examples/penguins_minimal.py +++ b/gptables/examples/penguins_minimal.py @@ -33,7 +33,7 @@ "Just another subtitle" ] penguins_scope = "Penguins" -penguins_source = "Source: Office for Penguin Statistics" +penguins_source = "Palmer Station, Antarctica" ## Define our GPTable penguins_table = gpt.GPTable(table=penguins_data, table_name=penguins_table_name, title=penguins_title, subtitles=penguins_subtitles, diff --git a/gptables/examples/penguins_notes.py b/gptables/examples/penguins_notes.py index fc76af35..0d3bc979 100644 --- a/gptables/examples/penguins_notes.py +++ b/gptables/examples/penguins_notes.py @@ -39,7 +39,7 @@ penguins_table_notes = {"species": "$$noteaboutx$$", 2: "$$noteaboutz$$"} #Columns can be referenced either by index or by name penguins_units = {2:"mm", "bill_depth_mm":"mm",4:"mm","body_mass_g":"g"} #As above for column referencing penguins_scope = "Penguins" -penguins_source = "Source: Office for Penguin Statistics" +penguins_source = "Palmer Station, Antarctica" kwargs = { "table_name": penguins_table_name, diff --git a/gptables/examples/penguins_theme.py b/gptables/examples/penguins_theme.py index 48ff5e06..05e53f3a 100644 --- a/gptables/examples/penguins_theme.py +++ b/gptables/examples/penguins_theme.py @@ -33,7 +33,7 @@ "Just another subtitle" ] penguins_scope = "Penguins" -penguins_source = "Source: Office for Penguin Statistics" +penguins_source = "Palmer Station, Antarctica" kwargs = { "table_name": penguins_table_name, From 4139b1367993049813ad7362e251e8f452b2ddd8 Mon Sep 17 00:00:00 2001 From: Milne Date: Fri, 28 Jun 2024 14:54:16 +0100 Subject: [PATCH 20/28] Removes old examples --- gptables/examples/R_install_dependency_file.R | 20 - gptables/examples/cor_multiple_sheets.py | 74 -- gptables/examples/coreB.csv | 217 ----- gptables/examples/iris.R | 69 -- gptables/examples/iris.csv | 151 --- gptables/examples/iris.py | 85 -- gptables/examples/titanic.csv | 888 ------------------ gptables/examples/titanic.py | 64 -- gptables/examples/titanic_notes.csv | 5 - 9 files changed, 1573 deletions(-) delete mode 100644 gptables/examples/R_install_dependency_file.R delete mode 100644 gptables/examples/cor_multiple_sheets.py delete mode 100644 gptables/examples/coreB.csv delete mode 100644 gptables/examples/iris.R delete mode 100644 gptables/examples/iris.csv delete mode 100644 gptables/examples/iris.py delete mode 100644 gptables/examples/titanic.csv delete mode 100644 gptables/examples/titanic.py delete mode 100644 gptables/examples/titanic_notes.csv diff --git a/gptables/examples/R_install_dependency_file.R b/gptables/examples/R_install_dependency_file.R deleted file mode 100644 index 002f2b95..00000000 --- a/gptables/examples/R_install_dependency_file.R +++ /dev/null @@ -1,20 +0,0 @@ -#' install packages from a list -#' -#' @description install any packages from a list of packages which R does not have -#' -#' @param pkglist list of packages to install -#' -#' @return NA -#' -#' @export - -packageRefresh <- function(pkglist) { - if(length(names(sessionInfo()$otherPkgs))) { - lapply(names(sessionInfo()$otherPkgs), function(pkgs) detach(paste0("package:", pkgs), - character.only = T)) - } - newPackages <- pkglist[!(pkglist %in% installed.packages()[,"Package"])] - if(length(newPackages)) { - install.packages(newPackages) - } - } \ No newline at end of file diff --git a/gptables/examples/cor_multiple_sheets.py b/gptables/examples/cor_multiple_sheets.py deleted file mode 100644 index 75b5eb96..00000000 --- a/gptables/examples/cor_multiple_sheets.py +++ /dev/null @@ -1,74 +0,0 @@ -""" -Cost of Reoffending - Multiple Sheets Example ---------------------------------------------- - -This example demonstrates how multiple sheets can be defined and written -to a single .xlsx file using ``gptables``. - -The elements dictionary below is used to define the metadata for each table, -with the sheet name as it's key. This metadata is used to generate the sheets -dictionary. ``gptables.write_workbook`` uses this dictionary to write each table -to the corresponding sheet. - -``gptables.GPTable`` objects can be constructed one by one, but this demonstrates -one way to make this definition concise. -""" -from copy import deepcopy -import gptables as gpt -import pandas as pd -from pathlib import Path - -## Read data and arrange -parent_dir = Path(__file__).parent -core_data = pd.read_csv(parent_dir / "coreB.csv") - -# 3 tables: summary, children and young people, and adults -summ = core_data.loc[:, ["age", "total_cost"]] -summ = summ.groupby("age").sum().reset_index() -summ.columns = ["Age group", "Total cost"] - -# This returns adults first as per the data -ages = core_data.age.unique() - -dct = {ages[0]: pd.DataFrame(), ages[1]: pd.DataFrame()} -for key in dct: - frame = core_data.loc[core_data.age == key, ["reoffence_group", "total_cost"]] - frame = frame.groupby("reoffence_group").sum().reset_index() - frame.columns = ["Reoffence group", "Total cost"] - dct[key] = frame - -dct["Summary"] = summ - - -## Define table elements for each table - -example = { - "title": "Cost of Reoffending", - "subtitles": ["12-month follow-up period for the 2016 offender cohort"], - "units": {1:"£"}, - "scope": "England and Wales", - "source": "Office for National Statistics", -} - -table_parameters_dict = {} -for table in ["summary", "adults", "children"]: - table_parameters = deepcopy(example) - table_parameters["table_name"] = f"{table}_table" - table_parameters["title"] = f"Cost of reoffending - {table}" - table_parameters_dict[table] = table_parameters - -elements = { - "Summary": table_parameters_dict["summary"], - "Adults": table_parameters_dict["adults"], - "Children and young people": table_parameters_dict["children"] -} - -## Generate a dictionary of sheet names to GPTable objects -## using the elements defined above -sheets = {name: gpt.GPTable(dct[name], **elements[name]) for name in dct} - -## Use write_workbook to win! -if __name__ == "__main__": - output_path = parent_dir / "python_cor_multiple_gptables.xlsx" - gpt.write_workbook(filename=output_path, sheets=sheets) - print("Output written at: ", output_path) diff --git a/gptables/examples/coreB.csv b/gptables/examples/coreB.csv deleted file mode 100644 index f98566ad..00000000 --- a/gptables/examples/coreB.csv +++ /dev/null @@ -1,217 +0,0 @@ -reoffence_group,age,number_wider_reoffences,cost_basket,total_cost,major_cost_category -Criminal damage and arson,Adults,48064,defensive_expenditure,2889289,Costs in anticipation of crime -Criminal damage and arson,Adults,48064,harm,13796622,Costs as a consequence of crime -Criminal damage and arson,Adults,48064,health_services,4653359,Costs as a consequence of crime -Criminal damage and arson,Adults,48064,insurance_admin,2721014,Costs in anticipation of crime -Criminal damage and arson,Adults,48064,lost_output,4349308,Costs as a consequence of crime -Criminal damage and arson,Adults,48064,other_cjs_costs,21430136,Costs in response to crime -Criminal damage and arson,Adults,48064,police_costs,8536417,Costs in response to crime -Criminal damage and arson,Adults,48064,property_loss,18953157,Costs as a consequence of crime -Criminal damage and arson,Adults,48064,victim_services,10955,Costs as a consequence of crime -Drug offences,Adults,33267,defensive_expenditure,0,Costs in anticipation of crime -Drug offences,Adults,33267,harm,0,Costs as a consequence of crime -Drug offences,Adults,33267,health_services,4873059,Costs as a consequence of crime -Drug offences,Adults,33267,insurance_admin,0,Costs in anticipation of crime -Drug offences,Adults,33267,lost_output,4948889,Costs as a consequence of crime -Drug offences,Adults,33267,other_cjs_costs,17696095,Costs in response to crime -Drug offences,Adults,33267,police_costs,7497775,Costs in response to crime -Drug offences,Adults,33267,property_loss,0,Costs as a consequence of crime -Drug offences,Adults,33267,victim_services,0,Costs as a consequence of crime -Fraud offences,Adults,861657,defensive_expenditure,155037969,Costs in anticipation of crime -Fraud offences,Adults,861657,harm,178733230,Costs as a consequence of crime -Fraud offences,Adults,861657,health_services,62508712,Costs as a consequence of crime -Fraud offences,Adults,861657,insurance_admin,43964525,Costs in anticipation of crime -Fraud offences,Adults,861657,lost_output,53715807,Costs as a consequence of crime -Fraud offences,Adults,861657,other_cjs_costs,149479385,Costs in response to crime -Fraud offences,Adults,861657,police_costs,52757430,Costs in response to crime -Fraud offences,Adults,861657,property_loss,439836926,Costs as a consequence of crime -Fraud offences,Adults,861657,victim_services,0,Costs as a consequence of crime -Miscellaneous crimes against society,Adults,22754,defensive_expenditure,15351216,Costs in anticipation of crime -Miscellaneous crimes against society,Adults,22754,harm,0,Costs as a consequence of crime -Miscellaneous crimes against society,Adults,22754,health_services,0,Costs as a consequence of crime -Miscellaneous crimes against society,Adults,22754,insurance_admin,0,Costs in anticipation of crime -Miscellaneous crimes against society,Adults,22754,lost_output,0,Costs as a consequence of crime -Miscellaneous crimes against society,Adults,22754,other_cjs_costs,30102825,Costs in response to crime -Miscellaneous crimes against society,Adults,22754,police_costs,30392965,Costs in response to crime -Miscellaneous crimes against society,Adults,22754,property_loss,0,Costs as a consequence of crime -Miscellaneous crimes against society,Adults,22754,victim_services,0,Costs as a consequence of crime -Possession of weapons offences,Adults,8952,defensive_expenditure,0,Costs in anticipation of crime -Possession of weapons offences,Adults,8952,harm,0,Costs as a consequence of crime -Possession of weapons offences,Adults,8952,health_services,0,Costs as a consequence of crime -Possession of weapons offences,Adults,8952,insurance_admin,0,Costs in anticipation of crime -Possession of weapons offences,Adults,8952,lost_output,0,Costs as a consequence of crime -Possession of weapons offences,Adults,8952,other_cjs_costs,3026481,Costs in response to crime -Possession of weapons offences,Adults,8952,police_costs,2345761,Costs in response to crime -Possession of weapons offences,Adults,8952,property_loss,0,Costs as a consequence of crime -Possession of weapons offences,Adults,8952,victim_services,0,Costs as a consequence of crime -Public order offences,Adults,106973,defensive_expenditure,3831191,Costs in anticipation of crime -Public order offences,Adults,106973,harm,35365958,Costs as a consequence of crime -Public order offences,Adults,106973,health_services,12276089,Costs as a consequence of crime -Public order offences,Adults,106973,insurance_admin,2946839,Costs in anticipation of crime -Public order offences,Adults,106973,lost_output,10535756,Costs as a consequence of crime -Public order offences,Adults,106973,other_cjs_costs,36471640,Costs in response to crime -Public order offences,Adults,106973,police_costs,13776048,Costs in response to crime -Public order offences,Adults,106973,property_loss,0,Costs as a consequence of crime -Public order offences,Adults,106973,victim_services,0,Costs as a consequence of crime -Robbery,Adults,81311,defensive_expenditure,20366584,Costs in anticipation of crime -Robbery,Adults,81311,harm,305692921,Costs as a consequence of crime -Robbery,Adults,81311,health_services,64071071,Costs as a consequence of crime -Robbery,Adults,81311,insurance_admin,12097360,Costs in anticipation of crime -Robbery,Adults,81311,lost_output,81028944,Costs as a consequence of crime -Robbery,Adults,81311,other_cjs_costs,311155008,Costs in response to crime -Robbery,Adults,81311,police_costs,85631215,Costs in response to crime -Robbery,Adults,81311,property_loss,87213039,Costs as a consequence of crime -Robbery,Adults,81311,victim_services,870602,Costs as a consequence of crime -Sexual offences,Adults,64213,defensive_expenditure,15248394,Costs in anticipation of crime -Sexual offences,Adults,64213,harm,379068148,Costs as a consequence of crime -Sexual offences,Adults,64213,health_services,30682849,Costs as a consequence of crime -Sexual offences,Adults,64213,insurance_admin,669551,Costs in anticipation of crime -Sexual offences,Adults,64213,lost_output,105331806,Costs as a consequence of crime -Sexual offences,Adults,64213,other_cjs_costs,38833966,Costs in response to crime -Sexual offences,Adults,64213,police_costs,74917685,Costs in response to crime -Sexual offences,Adults,64213,property_loss,0,Costs as a consequence of crime -Sexual offences,Adults,64213,victim_services,859983,Costs as a consequence of crime -Summary motoring,Adults,45904,defensive_expenditure,0,Costs in anticipation of crime -Summary motoring,Adults,45904,insurance_admin,0,Costs in anticipation of crime -Summary motoring,Adults,45904,harm,0,Costs as a consequence of crime -Summary motoring,Adults,45904,property_loss,0,Costs as a consequence of crime -Summary motoring,Adults,45904,victim_services,0,Costs as a consequence of crime -Summary motoring,Adults,45904,lost_output,0,Costs as a consequence of crime -Summary motoring,Adults,45904,health_services,0,Costs as a consequence of crime -Summary motoring,Adults,45904,other_cjs_costs,6893131,Costs in response to crime -Summary motoring,Adults,45905,police_costs,0,Costs in response to crime -Summary non-motoring,Adults,127017,defensive_expenditure,0,Costs in anticipation of crime -Summary non-motoring,Adults,127017,insurance_admin,0,Costs in anticipation of crime -Summary non-motoring,Adults,127017,harm,0,Costs as a consequence of crime -Summary non-motoring,Adults,127017,property_loss,0,Costs as a consequence of crime -Summary non-motoring,Adults,127017,victim_services,0,Costs as a consequence of crime -Summary non-motoring,Adults,127017,lost_output,0,Costs as a consequence of crime -Summary non-motoring,Adults,127017,health_services,0,Costs as a consequence of crime -Summary non-motoring,Adults,127017,other_cjs_costs,84077775,Costs in response to crime -Summary non-motoring,Adults,127018,police_costs,0,Costs in response to crime -Theft offences,Adults,2384035,defensive_expenditure,1735659916,Costs in anticipation of crime -Theft offences,Adults,2384035,harm,1144443127,Costs as a consequence of crime -Theft offences,Adults,2384035,health_services,388744813,Costs as a consequence of crime -Theft offences,Adults,2384035,insurance_admin,462585167,Costs in anticipation of crime -Theft offences,Adults,2384035,lost_output,448725827,Costs as a consequence of crime -Theft offences,Adults,2384035,other_cjs_costs,1608476852,Costs in response to crime -Theft offences,Adults,2384035,police_costs,638581774,Costs in response to crime -Theft offences,Adults,2384035,property_loss,2882583231,Costs as a consequence of crime -Theft offences,Adults,2384035,victim_services,49340,Costs as a consequence of crime -Violence against the person,Adults,394286,defensive_expenditure,94046118,Costs in anticipation of crime -Violence against the person,Adults,394286,harm,2388778926,Costs as a consequence of crime -Violence against the person,Adults,394286,health_services,242912234,Costs as a consequence of crime -Violence against the person,Adults,394286,insurance_admin,7493410,Costs in anticipation of crime -Violence against the person,Adults,394286,lost_output,564553450,Costs as a consequence of crime -Violence against the person,Adults,394286,other_cjs_costs,535286993,Costs in response to crime -Violence against the person,Adults,394286,police_costs,333711494,Costs in response to crime -Violence against the person,Adults,394286,property_loss,37961557,Costs as a consequence of crime -Violence against the person,Adults,394286,victim_services,1280286,Costs as a consequence of crime -Criminal damage and arson,Children and young people,12920,defensive_expenditure,776654,Costs in anticipation of crime -Criminal damage and arson,Children and young people,12920,harm,3708596,Costs as a consequence of crime -Criminal damage and arson,Children and young people,12920,health_services,1250845,Costs as a consequence of crime -Criminal damage and arson,Children and young people,12920,insurance_admin,731421,Costs in anticipation of crime -Criminal damage and arson,Children and young people,12920,lost_output,1169114,Costs as a consequence of crime -Criminal damage and arson,Children and young people,12920,other_cjs_costs,5760521,Costs in response to crime -Criminal damage and arson,Children and young people,12920,police_costs,2294629,Costs in response to crime -Criminal damage and arson,Children and young people,12920,property_loss,5094697,Costs as a consequence of crime -Criminal damage and arson,Children and young people,12920,victim_services,2945,Costs as a consequence of crime -Drug offences,Children and young people,5091,defensive_expenditure,0,Costs in anticipation of crime -Drug offences,Children and young people,5091,harm,0,Costs as a consequence of crime -Drug offences,Children and young people,5091,health_services,745707,Costs as a consequence of crime -Drug offences,Children and young people,5091,insurance_admin,0,Costs in anticipation of crime -Drug offences,Children and young people,5091,lost_output,757311,Costs as a consequence of crime -Drug offences,Children and young people,5091,other_cjs_costs,2707971,Costs in response to crime -Drug offences,Children and young people,5091,police_costs,1147358,Costs in response to crime -Drug offences,Children and young people,5091,property_loss,0,Costs as a consequence of crime -Drug offences,Children and young people,5091,victim_services,0,Costs as a consequence of crime -Fraud offences,Children and young people,54992,defensive_expenditure,9894646,Costs in anticipation of crime -Fraud offences,Children and young people,54992,harm,11406897,Costs as a consequence of crime -Fraud offences,Children and young people,54992,health_services,3989356,Costs as a consequence of crime -Fraud offences,Children and young people,54992,insurance_admin,2805851,Costs in anticipation of crime -Fraud offences,Children and young people,54992,lost_output,3428185,Costs as a consequence of crime -Fraud offences,Children and young people,54992,other_cjs_costs,9539893,Costs in response to crime -Fraud offences,Children and young people,54992,police_costs,3367021,Costs in response to crime -Fraud offences,Children and young people,54992,property_loss,28070742,Costs as a consequence of crime -Fraud offences,Children and young people,54992,victim_services,0,Costs as a consequence of crime -Miscellaneous crimes against society,Children and young people,1962,defensive_expenditure,1323483,Costs in anticipation of crime -Miscellaneous crimes against society,Children and young people,1962,harm,0,Costs as a consequence of crime -Miscellaneous crimes against society,Children and young people,1962,health_services,0,Costs as a consequence of crime -Miscellaneous crimes against society,Children and young people,1962,insurance_admin,0,Costs in anticipation of crime -Miscellaneous crimes against society,Children and young people,1962,lost_output,0,Costs as a consequence of crime -Miscellaneous crimes against society,Children and young people,1962,other_cjs_costs,2595273,Costs in response to crime -Miscellaneous crimes against society,Children and young people,1962,police_costs,2620287,Costs in response to crime -Miscellaneous crimes against society,Children and young people,1962,property_loss,0,Costs as a consequence of crime -Miscellaneous crimes against society,Children and young people,1962,victim_services,0,Costs as a consequence of crime -Possession of weapons offences,Children and young people,2460,defensive_expenditure,0,Costs in anticipation of crime -Possession of weapons offences,Children and young people,2460,harm,0,Costs as a consequence of crime -Possession of weapons offences,Children and young people,2460,health_services,0,Costs as a consequence of crime -Possession of weapons offences,Children and young people,2460,insurance_admin,0,Costs in anticipation of crime -Possession of weapons offences,Children and young people,2460,lost_output,0,Costs as a consequence of crime -Possession of weapons offences,Children and young people,2460,other_cjs_costs,831493,Costs in response to crime -Possession of weapons offences,Children and young people,2460,police_costs,644473,Costs in response to crime -Possession of weapons offences,Children and young people,2460,property_loss,0,Costs as a consequence of crime -Possession of weapons offences,Children and young people,2460,victim_services,0,Costs as a consequence of crime -Public order offences,Children and young people,10917,defensive_expenditure,390984,Costs in anticipation of crime -Public order offences,Children and young people,10917,harm,3609199,Costs as a consequence of crime -Public order offences,Children and young people,10917,health_services,1252811,Costs as a consequence of crime -Public order offences,Children and young people,10917,insurance_admin,300733,Costs in anticipation of crime -Public order offences,Children and young people,10917,lost_output,1075204,Costs as a consequence of crime -Public order offences,Children and young people,10917,other_cjs_costs,3722037,Costs in response to crime -Public order offences,Children and young people,10917,police_costs,1405886,Costs in response to crime -Public order offences,Children and young people,10917,property_loss,0,Costs as a consequence of crime -Public order offences,Children and young people,10917,victim_services,0,Costs as a consequence of crime -Robbery,Children and young people,40732,defensive_expenditure,10202557,Costs in anticipation of crime -Robbery,Children and young people,40732,harm,153135614,Costs as a consequence of crime -Robbery,Children and young people,40732,health_services,32096140,Costs as a consequence of crime -Robbery,Children and young people,40732,insurance_admin,6060123,Costs in anticipation of crime -Robbery,Children and young people,40732,lost_output,40591117,Costs as a consequence of crime -Robbery,Children and young people,40732,other_cjs_costs,155871824,Costs in response to crime -Robbery,Children and young people,40732,police_costs,42896605,Costs in response to crime -Robbery,Children and young people,40732,property_loss,43689014,Costs as a consequence of crime -Robbery,Children and young people,40732,victim_services,436125,Costs as a consequence of crime -Sexual offences,Children and young people,7042,defensive_expenditure,1672277,Costs in anticipation of crime -Sexual offences,Children and young people,7042,harm,41572042,Costs as a consequence of crime -Sexual offences,Children and young people,7042,health_services,3364959,Costs as a consequence of crime -Sexual offences,Children and young people,7042,insurance_admin,73429,Costs in anticipation of crime -Sexual offences,Children and young people,7042,lost_output,11551639,Costs as a consequence of crime -Sexual offences,Children and young people,7042,other_cjs_costs,4258884,Costs in response to crime -Sexual offences,Children and young people,7042,police_costs,8216151,Costs in response to crime -Sexual offences,Children and young people,7042,property_loss,0,Costs as a consequence of crime -Sexual offences,Children and young people,7042,victim_services,94313,Costs as a consequence of crime -Summary motoring,Children and young people,4913,defensive_expenditure,0,Costs in anticipation of crime -Summary motoring,Children and young people,4913,insurance_admin,0,Costs in anticipation of crime -Summary motoring,Children and young people,4913,harm,0,Costs as a consequence of crime -Summary motoring,Children and young people,4913,property_loss,0,Costs as a consequence of crime -Summary motoring,Children and young people,4913,victim_services,0,Costs as a consequence of crime -Summary motoring,Children and young people,4913,lost_output,0,Costs as a consequence of crime -Summary motoring,Children and young people,4913,health_services,0,Costs as a consequence of crime -Summary motoring,Children and young people,4913,other_cjs_costs,737756,Costs in response to crime -Summary motoring,Children and young people,4913,police_costs,0,Costs in response to crime -Summary non-motoring,Children and young people,21907,defensive_expenditure,0,Costs in anticipation of crime -Summary non-motoring,Children and young people,21907,insurance_admin,0,Costs in anticipation of crime -Summary non-motoring,Children and young people,21907,harm,0,Costs as a consequence of crime -Summary non-motoring,Children and young people,21907,property_loss,0,Costs as a consequence of crime -Summary non-motoring,Children and young people,21907,victim_services,0,Costs as a consequence of crime -Summary non-motoring,Children and young people,21907,lost_output,0,Costs as a consequence of crime -Summary non-motoring,Children and young people,21907,health_services,0,Costs as a consequence of crime -Summary non-motoring,Children and young people,21907,other_cjs_costs,14501144,Costs in response to crime -Summary non-motoring,Children and young people,21907,police_costs,0,Costs in response to crime -Theft offences,Children and young people,136192,defensive_expenditure,99152476,Costs in anticipation of crime -Theft offences,Children and young people,136192,harm,65378228,Costs as a consequence of crime -Theft offences,Children and young people,136192,health_services,22207698,Costs as a consequence of crime -Theft offences,Children and young people,136192,insurance_admin,26425952,Costs in anticipation of crime -Theft offences,Children and young people,136192,lost_output,25634214,Costs as a consequence of crime -Theft offences,Children and young people,136192,other_cjs_costs,91886931,Costs in response to crime -Theft offences,Children and young people,136192,police_costs,36480052,Costs in response to crime -Theft offences,Children and young people,136192,property_loss,164672389,Costs as a consequence of crime -Theft offences,Children and young people,136192,victim_services,2819,Costs as a consequence of crime -Violence against the person,Children and young people,24208,defensive_expenditure,5774062,Costs in anticipation of crime -Violence against the person,Children and young people,24208,harm,146661636,Costs as a consequence of crime -Violence against the person,Children and young people,24208,health_services,14913856,Costs as a consequence of crime -Violence against the person,Children and young people,24208,insurance_admin,460066,Costs in anticipation of crime -Violence against the person,Children and young people,24208,lost_output,34661363,Costs as a consequence of crime -Violence against the person,Children and young people,24208,other_cjs_costs,32864517,Costs in response to crime -Violence against the person,Children and young people,24208,police_costs,20488574,Costs in response to crime -Violence against the person,Children and young people,24208,property_loss,2330690,Costs as a consequence of crime -Violence against the person,Children and young people,24208,victim_services,78605,Costs as a consequence of crime diff --git a/gptables/examples/iris.R b/gptables/examples/iris.R deleted file mode 100644 index a5036813..00000000 --- a/gptables/examples/iris.R +++ /dev/null @@ -1,69 +0,0 @@ - -#Iris - R Example -#---------------------- - -#This example demonstrates use of the ``gptables.write_workbook`` function in R. -#This API function is designed for production of consistently structured and formatted tables. - -#Summary statistics from the classic iris dataset are used to build a ``gptables$GPTable`` -#object. Elements of metadata are provided to the corresponding parameters of the class. -#Where you wish to provide no metadata in required parameters, use ``None``. - -#Table formatting can be defined as a ``gptable$Theme``, which is passed to the API functions -# using the ``theme`` parameter. Or you can reply on our default - gptheme. - - -# Reticulate example works on R version 4.0.1 or less -source("gptables/examples/R_install_dependency_file.R") - -packagesReq <- c("dplyr", "reticulate", "magrittr") -packageRefresh(packagesReq) - -library("magrittr") - -gpt <- reticulate::import("gptables") -pd <- reticulate::import("pandas") - -iris_df <- reticulate::r_to_py( - iris[c(5,1,2,3,4)]%>% - dplyr::group_by(Species) %>% - dplyr::summarize("Mean Sepal Length" = mean(Sepal.Length, na.rm=TRUE), - "Mean Sepal Width" = mean(Sepal.Width, na.rm=TRUE) - ) -) - -table_name = "iris_statistics" -title = "Mean Iris$$note2$$ sepal dimensions" -subtitles = c("1936 Fisher, R.A; The use of multiple measurements in taxonomic problems$$note1$$", - "Just another subtitle") -units = reticulate::dict(list("1" = "cm", "2" = "cm"), convert = FALSE) -table_notes = reticulate::dict(list("0" = "$$note1$$", "2" = "$$note3$$"), convert = FALSE) -scope = "Iris" -souce = "Source: Office for Iris Statistics" -index_columns = reticulate::py_dict(reticulate::py_eval('2'), "Species") - - -table = gpt$GPTable(table = iris_df, - table_name = table_name, - title = title, - subtitles = subtitles, - units = units, - table_notes = table_notes, - scope = scope, - source = souce, - index_columns = index_columns) - -notes = reticulate::dict(list("Note reference" = c("note1", "note2", "note3"), - "Note text" = c("I've got 99 problems and taxonomy is one.", "Goo Goo Dolls, 1998.", "Just another note"), - "Useful link" = c("[google](https://www.google.com)", "[duckduckgo](https://duckduckgo.com/)", "[ONS](https://www.ons.gov.uk)")), - convert = FALSE) - -notes_table = pd$DataFrame$from_dict(notes) - -output_path <- "gptables/examples/R_iris_gptable.xlsx" - -gpt$write_workbook(filename = output_path, - sheets = reticulate::dict(list("iris" = table)), - notes_table = notes_table, - contentsheet_options = reticulate::dict(list("additional_elements" = c("subtitles", "scope"))) - ) diff --git a/gptables/examples/iris.csv b/gptables/examples/iris.csv deleted file mode 100644 index d4c3f946..00000000 --- a/gptables/examples/iris.csv +++ /dev/null @@ -1,151 +0,0 @@ -sepal_length,sepal_width,petal_length,petal_width,class -5.1,3.5,1.4,0.2,Iris-setosa -4.9,3,1.4,0.2,Iris-setosa -4.7,3.2,1.3,0.2,Iris-setosa -4.6,3.1,1.5,0.2,Iris-setosa -5,3.6,1.4,0.2,Iris-setosa -5.4,3.9,1.7,0.4,Iris-setosa -4.6,3.4,1.4,0.3,Iris-setosa -5,3.4,1.5,0.2,Iris-setosa -4.4,2.9,1.4,0.2,Iris-setosa -4.9,3.1,1.5,0.1,Iris-setosa -5.4,3.7,1.5,0.2,Iris-setosa -4.8,3.4,1.6,0.2,Iris-setosa -4.8,3,1.4,0.1,Iris-setosa -4.3,3,1.1,0.1,Iris-setosa -5.8,4,1.2,0.2,Iris-setosa -5.7,4.4,1.5,0.4,Iris-setosa -5.4,3.9,1.3,0.4,Iris-setosa -5.1,3.5,1.4,0.3,Iris-setosa -5.7,3.8,1.7,0.3,Iris-setosa -5.1,3.8,1.5,0.3,Iris-setosa -5.4,3.4,1.7,0.2,Iris-setosa -5.1,3.7,1.5,0.4,Iris-setosa -4.6,3.6,1,0.2,Iris-setosa -5.1,3.3,1.7,0.5,Iris-setosa -4.8,3.4,1.9,0.2,Iris-setosa -5,3,1.6,0.2,Iris-setosa -5,3.4,1.6,0.4,Iris-setosa -5.2,3.5,1.5,0.2,Iris-setosa -5.2,3.4,1.4,0.2,Iris-setosa -4.7,3.2,1.6,0.2,Iris-setosa -4.8,3.1,1.6,0.2,Iris-setosa -5.4,3.4,1.5,0.4,Iris-setosa -5.2,4.1,1.5,0.1,Iris-setosa -5.5,4.2,1.4,0.2,Iris-setosa -4.9,3.1,1.5,0.1,Iris-setosa -5,3.2,1.2,0.2,Iris-setosa -5.5,3.5,1.3,0.2,Iris-setosa -4.9,3.1,1.5,0.1,Iris-setosa -4.4,3,1.3,0.2,Iris-setosa -5.1,3.4,1.5,0.2,Iris-setosa -5,3.5,1.3,0.3,Iris-setosa -4.5,2.3,1.3,0.3,Iris-setosa -4.4,3.2,1.3,0.2,Iris-setosa -5,3.5,1.6,0.6,Iris-setosa -5.1,3.8,1.9,0.4,Iris-setosa -4.8,3,1.4,0.3,Iris-setosa -5.1,3.8,1.6,0.2,Iris-setosa -4.6,3.2,1.4,0.2,Iris-setosa -5.3,3.7,1.5,0.2,Iris-setosa -5,3.3,1.4,0.2,Iris-setosa -7,3.2,4.7,1.4,Iris-versicolor -6.4,3.2,4.5,1.5,Iris-versicolor -6.9,3.1,4.9,1.5,Iris-versicolor -5.5,2.3,4,1.3,Iris-versicolor -6.5,2.8,4.6,1.5,Iris-versicolor -5.7,2.8,4.5,1.3,Iris-versicolor -6.3,3.3,4.7,1.6,Iris-versicolor -4.9,2.4,3.3,1,Iris-versicolor -6.6,2.9,4.6,1.3,Iris-versicolor -5.2,2.7,3.9,1.4,Iris-versicolor -5,2,3.5,1,Iris-versicolor -5.9,3,4.2,1.5,Iris-versicolor -6,2.2,4,1,Iris-versicolor -6.1,2.9,4.7,1.4,Iris-versicolor -5.6,2.9,3.6,1.3,Iris-versicolor -6.7,3.1,4.4,1.4,Iris-versicolor -5.6,3,4.5,1.5,Iris-versicolor -5.8,2.7,4.1,1,Iris-versicolor -6.2,2.2,4.5,1.5,Iris-versicolor -5.6,2.5,3.9,1.1,Iris-versicolor -5.9,3.2,4.8,1.8,Iris-versicolor -6.1,2.8,4,1.3,Iris-versicolor -6.3,2.5,4.9,1.5,Iris-versicolor -6.1,2.8,4.7,1.2,Iris-versicolor -6.4,2.9,4.3,1.3,Iris-versicolor -6.6,3,4.4,1.4,Iris-versicolor -6.8,2.8,4.8,1.4,Iris-versicolor -6.7,3,5,1.7,Iris-versicolor -6,2.9,4.5,1.5,Iris-versicolor -5.7,2.6,3.5,1,Iris-versicolor -5.5,2.4,3.8,1.1,Iris-versicolor -5.5,2.4,3.7,1,Iris-versicolor -5.8,2.7,3.9,1.2,Iris-versicolor -6,2.7,5.1,1.6,Iris-versicolor -5.4,3,4.5,1.5,Iris-versicolor -6,3.4,4.5,1.6,Iris-versicolor -6.7,3.1,4.7,1.5,Iris-versicolor -6.3,2.3,4.4,1.3,Iris-versicolor -5.6,3,4.1,1.3,Iris-versicolor -5.5,2.5,4,1.3,Iris-versicolor -5.5,2.6,4.4,1.2,Iris-versicolor -6.1,3,4.6,1.4,Iris-versicolor -5.8,2.6,4,1.2,Iris-versicolor -5,2.3,3.3,1,Iris-versicolor -5.6,2.7,4.2,1.3,Iris-versicolor -5.7,3,4.2,1.2,Iris-versicolor -5.7,2.9,4.2,1.3,Iris-versicolor -6.2,2.9,4.3,1.3,Iris-versicolor -5.1,2.5,3,1.1,Iris-versicolor -5.7,2.8,4.1,1.3,Iris-versicolor -6.3,3.3,6,2.5,Iris-virginica -5.8,2.7,5.1,1.9,Iris-virginica -7.1,3,5.9,2.1,Iris-virginica -6.3,2.9,5.6,1.8,Iris-virginica -6.5,3,5.8,2.2,Iris-virginica -7.6,3,6.6,2.1,Iris-virginica -4.9,2.5,4.5,1.7,Iris-virginica -7.3,2.9,6.3,1.8,Iris-virginica -6.7,2.5,5.8,1.8,Iris-virginica -7.2,3.6,6.1,2.5,Iris-virginica -6.5,3.2,5.1,2,Iris-virginica -6.4,2.7,5.3,1.9,Iris-virginica -6.8,3,5.5,2.1,Iris-virginica -5.7,2.5,5,2,Iris-virginica -5.8,2.8,5.1,2.4,Iris-virginica -6.4,3.2,5.3,2.3,Iris-virginica -6.5,3,5.5,1.8,Iris-virginica -7.7,3.8,6.7,2.2,Iris-virginica -7.7,2.6,6.9,2.3,Iris-virginica -6,2.2,5,1.5,Iris-virginica -6.9,3.2,5.7,2.3,Iris-virginica -5.6,2.8,4.9,2,Iris-virginica -7.7,2.8,6.7,2,Iris-virginica -6.3,2.7,4.9,1.8,Iris-virginica -6.7,3.3,5.7,2.1,Iris-virginica -7.2,3.2,6,1.8,Iris-virginica -6.2,2.8,4.8,1.8,Iris-virginica -6.1,3,4.9,1.8,Iris-virginica -6.4,2.8,5.6,2.1,Iris-virginica -7.2,3,5.8,1.6,Iris-virginica -7.4,2.8,6.1,1.9,Iris-virginica -7.9,3.8,6.4,2,Iris-virginica -6.4,2.8,5.6,2.2,Iris-virginica -6.3,2.8,5.1,1.5,Iris-virginica -6.1,2.6,5.6,1.4,Iris-virginica -7.7,3,6.1,2.3,Iris-virginica -6.3,3.4,5.6,2.4,Iris-virginica -6.4,3.1,5.5,1.8,Iris-virginica -6,3,4.8,1.8,Iris-virginica -6.9,3.1,5.4,2.1,Iris-virginica -6.7,3.1,5.6,2.4,Iris-virginica -6.9,3.1,5.1,2.3,Iris-virginica -5.8,2.7,5.1,1.9,Iris-virginica -6.8,3.2,5.9,2.3,Iris-virginica -6.7,3.3,5.7,2.5,Iris-virginica -6.7,3,5.2,2.3,Iris-virginica -6.3,2.5,5,1.9,Iris-virginica -6.5,3,5.2,2,Iris-virginica -6.2,3.4,5.4,2.3,Iris-virginica -5.9,3,5.1,1.8,Iris-virginica diff --git a/gptables/examples/iris.py b/gptables/examples/iris.py deleted file mode 100644 index 567fcb07..00000000 --- a/gptables/examples/iris.py +++ /dev/null @@ -1,85 +0,0 @@ -""" -Iris - Minimal Example ----------------------- - -This example demonstrates use of the ``gptables.write_workbook`` function. -This API function is designed for production of consistently structured and formatted tables. - -Summary statistics from the classic iris dataset are used to build a ``gptables.GPTable`` -object. Elements of metadata are provided to the corresponding parameters of the class. -Where you wish to provide no metadata in required parameters, use ``None``. - -Table formatting can be defined as a ``gptable.Theme``, which is passed to the API functions - using the ``theme`` parameter. Or you can reply on our default - gptheme. -""" -import gptables as gpt -import pandas as pd -import numpy as np -from pathlib import Path - -## Read data and arrange -parent_dir = Path(__file__).parent - -iris_data = pd.read_csv(parent_dir / "iris.csv") -iris_data = iris_data.loc[:, ["class", "sepal_length", "sepal_width"]] - -iris_summary = iris_data.groupby("class").agg(np.mean) -iris_summary.index = [_[5:].capitalize() for _ in iris_summary.index] -iris_summary.reset_index(inplace=True) -iris_summary.rename( - columns={ - "index": "Class", - "sepal_length": "Mean Sepal Length", - "sepal_width": "Mean Sepal Width", - }, - inplace=True, - ) - -## Define table elements -table_name = "iris_statistics" -title = "Mean Iris$$note2$$ sepal dimensions" -subtitles = [ - "1936 Fisher, R.A; The use of multiple measurements in taxonomic problems$$note1$$", - "Just another subtitle" - ] -units = {1:"cm", 2:"cm"} -table_notes = {0: "$$note1$$", 2: "$$note3$$"} -scope = "Iris" -source = "Source: Office for Iris Statistics" -index = {2: 0} # Column 0 is a level 2 index - -# or use kwargs to pass these to the appropriate parameters -kwargs = { - "table_name": table_name, - "title": title, - "subtitles": subtitles, - "units": units, - "table_notes": table_notes, - "scope": scope, - "source": source, - "index_columns": index, - } - -## Define our GPTable -iris_table = gpt.GPTable(table=iris_summary, **kwargs) - -sheets = {"Iris Flower Dimensions": iris_table} - -## Notesheet -notes = { - "Note reference": ["note1", "note2", "note3"], - "Note text": ["I've got 99 problems and taxonomy is one.", "Goo Goo Dolls, 1998.", "Just another note"], - "Useful link": ["[google](https://www.google.com)", "[duckduckgo](https://duckduckgo.com/)", "[ONS](https://www.ons.gov.uk)"], - } -notes_table = pd.DataFrame.from_dict(notes) - -## Use write_workbook to win! -if __name__ == "__main__": - output_path = parent_dir / "python_iris_gptable.xlsx" - gpt.write_workbook( - filename=output_path, - sheets=sheets, - notes_table=notes_table, - contentsheet_options={"additional_elements": ["subtitles", "scope"]} - ) - print("Output written at: ", output_path) diff --git a/gptables/examples/titanic.csv b/gptables/examples/titanic.csv deleted file mode 100644 index 853188c8..00000000 --- a/gptables/examples/titanic.csv +++ /dev/null @@ -1,888 +0,0 @@ -Survived,Pclass,Name,Sex,Age,Siblings/Spouses Aboard,Parents/Children Aboard,Fare -0,3,Mr. Owen Harris Braund,male,22,1,0,7.25 -1,1,Mrs. John Bradley (Florence Briggs Thayer) Cumings,female,38,1,0,71.2833 -1,3,Miss. Laina Heikkinen,female,26,0,0,7.925 -1,1,Mrs. Jacques Heath (Lily May Peel) Futrelle,female,35,1,0,53.1 -0,3,Mr. William Henry Allen,male,35,0,0,8.05 -0,3,Mr. James Moran,male,27,0,0,8.4583 -0,1,Mr. Timothy J McCarthy,male,54,0,0,51.8625 -0,3,Master. Gosta Leonard Palsson,male,2,3,1,21.075 -1,3,Mrs. Oscar W (Elisabeth Vilhelmina Berg) Johnson,female,27,0,2,11.1333 -1,2,Mrs. Nicholas (Adele Achem) Nasser,female,14,1,0,30.0708 -1,3,Miss. Marguerite Rut Sandstrom,female,4,1,1,16.7 -1,1,Miss. Elizabeth Bonnell,female,58,0,0,26.55 -0,3,Mr. William Henry Saundercock,male,20,0,0,8.05 -0,3,Mr. Anders Johan Andersson,male,39,1,5,31.275 -0,3,Miss. Hulda Amanda Adolfina Vestrom,female,14,0,0,7.8542 -1,2,Mrs. (Mary D Kingcome) Hewlett,female,55,0,0,16 -0,3,Master. Eugene Rice,male,2,4,1,29.125 -1,2,Mr. Charles Eugene Williams,male,23,0,0,13 -0,3,Mrs. Julius (Emelia Maria Vandemoortele) Vander Planke,female,31,1,0,18 -1,3,Mrs. Fatima Masselmani,female,22,0,0,7.225 -0,2,Mr. Joseph J Fynney,male,35,0,0,26 -1,2,Mr. Lawrence Beesley,male,34,0,0,13 -1,3,Miss. Anna McGowan,female,15,0,0,8.0292 -1,1,Mr. William Thompson Sloper,male,28,0,0,35.5 -0,3,Miss. Torborg Danira Palsson,female,8,3,1,21.075 -1,3,Mrs. Carl Oscar (Selma Augusta Emilia Johansson) Asplund,female,38,1,5,31.3875 -0,3,Mr. Farred Chehab Emir,male,26,0,0,7.225 -0,1,Mr. Charles Alexander Fortune,male,19,3,2,263 -1,3,Miss. Ellen O'Dwyer,female,24,0,0,7.8792 -0,3,Mr. Lalio Todoroff,male,23,0,0,7.8958 -0,1,Don. Manuel E Uruchurtu,male,40,0,0,27.7208 -1,1,Mrs. William Augustus (Marie Eugenie) Spencer,female,48,1,0,146.5208 -1,3,Miss. Mary Agatha Glynn,female,18,0,0,7.75 -0,2,Mr. Edward H Wheadon,male,66,0,0,10.5 -0,1,Mr. Edgar Joseph Meyer,male,28,1,0,82.1708 -0,1,Mr. Alexander Oskar Holverson,male,42,1,0,52 -1,3,Mr. Hanna Mamee,male,18,0,0,7.2292 -0,3,Mr. Ernest Charles Cann,male,21,0,0,8.05 -0,3,Miss. Augusta Maria Vander Planke,female,18,2,0,18 -1,3,Miss. Jamila Nicola-Yarred,female,14,1,0,11.2417 -0,3,Mrs. Johan (Johanna Persdotter Larsson) Ahlin,female,40,1,0,9.475 -0,2,Mrs. William John Robert (Dorothy Ann Wonnacott) Turpin,female,27,1,0,21 -1,2,Miss. Simonne Marie Anne Andree Laroche,female,3,1,2,41.5792 -1,3,Miss. Margaret Delia Devaney,female,19,0,0,7.8792 -0,3,Mr. William John Rogers,male,30,0,0,8.05 -0,3,Mr. Denis Lennon,male,20,1,0,15.5 -1,3,Miss. Bridget O'Driscoll,female,27,0,0,7.75 -0,3,Mr. Youssef Samaan,male,16,2,0,21.6792 -0,3,Mrs. Josef (Josefine Franchi) Arnold-Franchi,female,18,1,0,17.8 -0,3,Master. Juha Niilo Panula,male,7,4,1,39.6875 -0,3,Mr. Richard Cater Nosworthy,male,21,0,0,7.8 -1,1,Mrs. Henry Sleeper (Myna Haxtun) Harper,female,49,1,0,76.7292 -1,2,Mrs. Lizzie (Elizabeth Anne Wilkinson) Faunthorpe,female,29,1,0,26 -0,1,Mr. Engelhart Cornelius Ostby,male,65,0,1,61.9792 -1,1,Mr. Hugh Woolner,male,46,0,0,35.5 -1,2,Miss. Emily Rugg,female,21,0,0,10.5 -0,3,Mr. Mansouer Novel,male,28.5,0,0,7.2292 -1,2,Miss. Constance Mirium West,female,5,1,2,27.75 -0,3,Master. William Frederick Goodwin,male,11,5,2,46.9 -0,3,Mr. Orsen Sirayanian,male,22,0,0,7.2292 -1,1,Miss. Amelie Icard,female,38,0,0,80 -0,1,Mr. Henry Birkhardt Harris,male,45,1,0,83.475 -0,3,Master. Harald Skoog,male,4,3,2,27.9 -0,1,Mr. Albert A Stewart,male,64,0,0,27.7208 -1,3,Master. Gerios Moubarek,male,7,1,1,15.2458 -1,2,Mrs. (Elizabeth Ramell) Nye,female,29,0,0,10.5 -0,3,Mr. Ernest James Crease,male,19,0,0,8.1583 -1,3,Miss. Erna Alexandra Andersson,female,17,4,2,7.925 -0,3,Mr. Vincenz Kink,male,26,2,0,8.6625 -0,2,Mr. Stephen Curnow Jenkin,male,32,0,0,10.5 -0,3,Miss. Lillian Amy Goodwin,female,16,5,2,46.9 -0,2,Mr. Ambrose Jr Hood,male,21,0,0,73.5 -0,3,Mr. Apostolos Chronopoulos,male,26,1,0,14.4542 -1,3,Mr. Lee Bing,male,32,0,0,56.4958 -0,3,Mr. Sigurd Hansen Moen,male,25,0,0,7.65 -0,3,Mr. Ivan Staneff,male,23,0,0,7.8958 -0,3,Mr. Rahamin Haim Moutal,male,28,0,0,8.05 -1,2,Master. Alden Gates Caldwell,male,0.83,0,2,29 -1,3,Miss. Elizabeth Dowdell,female,30,0,0,12.475 -0,3,Mr. Achille Waelens,male,22,0,0,9 -1,3,Mr. Jan Baptist Sheerlinck,male,29,0,0,9.5 -1,3,Miss. Brigdet Delia McDermott,female,31,0,0,7.7875 -0,1,Mr. Francisco M Carrau,male,28,0,0,47.1 -1,2,Miss. Bertha Ilett,female,17,0,0,10.5 -1,3,Mrs. Karl Alfred (Maria Mathilda Gustafsson) Backstrom,female,33,3,0,15.85 -0,3,Mr. William Neal Ford,male,16,1,3,34.375 -0,3,Mr. Selman Francis Slocovski,male,20,0,0,8.05 -1,1,Miss. Mabel Helen Fortune,female,23,3,2,263 -0,3,Mr. Francesco Celotti,male,24,0,0,8.05 -0,3,Mr. Emil Christmann,male,29,0,0,8.05 -0,3,Mr. Paul Edvin Andreasson,male,20,0,0,7.8542 -0,1,Mr. Herbert Fuller Chaffee,male,46,1,0,61.175 -0,3,Mr. Bertram Frank Dean,male,26,1,2,20.575 -0,3,Mr. Daniel Coxon,male,59,0,0,7.25 -0,3,Mr. Charles Joseph Shorney,male,22,0,0,8.05 -0,1,Mr. George B Goldschmidt,male,71,0,0,34.6542 -1,1,Mr. William Bertram Greenfield,male,23,0,1,63.3583 -1,2,Mrs. John T (Ada Julia Bone) Doling,female,34,0,1,23 -0,2,Mr. Sinai Kantor,male,34,1,0,26 -0,3,Miss. Matilda Petranec,female,28,0,0,7.8958 -0,3,Mr. Pastcho Petroff,male,29,0,0,7.8958 -0,1,Mr. Richard Frasar White,male,21,0,1,77.2875 -0,3,Mr. Gustaf Joel Johansson,male,33,0,0,8.6542 -0,3,Mr. Anders Vilhelm Gustafsson,male,37,2,0,7.925 -0,3,Mr. Stoytcho Mionoff,male,28,0,0,7.8958 -1,3,Miss. Anna Kristine Salkjelsvik,female,21,0,0,7.65 -1,3,Mr. Albert Johan Moss,male,29,0,0,7.775 -0,3,Mr. Tido Rekic,male,38,0,0,7.8958 -1,3,Miss. Bertha Moran,female,28,1,0,24.15 -0,1,Mr. Walter Chamberlain Porter,male,47,0,0,52 -0,3,Miss. Hileni Zabour,female,14.5,1,0,14.4542 -0,3,Mr. David John Barton,male,22,0,0,8.05 -0,3,Miss. Katriina Jussila,female,20,1,0,9.825 -0,3,Miss. Malake Attalah,female,17,0,0,14.4583 -0,3,Mr. Edvard Pekoniemi,male,21,0,0,7.925 -0,3,Mr. Patrick Connors,male,70.5,0,0,7.75 -0,2,Mr. William John Robert Turpin,male,29,1,0,21 -0,1,Mr. Quigg Edmond Baxter,male,24,0,1,247.5208 -0,3,Miss. Ellis Anna Maria Andersson,female,2,4,2,31.275 -0,2,Mr. Stanley George Hickman,male,21,2,0,73.5 -0,3,Mr. Leonard Charles Moore,male,19,0,0,8.05 -0,2,Mr. Nicholas Nasser,male,32.5,1,0,30.0708 -1,2,Miss. Susan Webber,female,32.5,0,0,13 -0,1,Mr. Percival Wayland White,male,54,0,1,77.2875 -1,3,Master. Elias Nicola-Yarred,male,12,1,0,11.2417 -0,3,Mr. Martin McMahon,male,19,0,0,7.75 -1,3,Mr. Fridtjof Arne Madsen,male,24,0,0,7.1417 -1,3,Miss. Anna Peter,female,2,1,1,22.3583 -0,3,Mr. Johan Ekstrom,male,45,0,0,6.975 -0,3,Mr. Jozef Drazenoic,male,33,0,0,7.8958 -0,3,Mr. Domingos Fernandeo Coelho,male,20,0,0,7.05 -0,3,Mrs. Alexander A (Grace Charity Laury) Robins,female,47,1,0,14.5 -1,2,Mrs. Leopold (Mathilde Francoise Pede) Weisz,female,29,1,0,26 -0,2,Mr. Samuel James Hayden Sobey,male,25,0,0,13 -0,2,Mr. Emile Richard,male,23,0,0,15.0458 -1,1,Miss. Helen Monypeny Newsom,female,19,0,2,26.2833 -0,1,Mr. Jacques Heath Futrelle,male,37,1,0,53.1 -0,3,Mr. Olaf Elon Osen,male,16,0,0,9.2167 -0,1,Mr. Victor Giglio,male,24,0,0,79.2 -0,3,Mrs. Joseph (Sultana) Boulos,female,40,0,2,15.2458 -1,3,Miss. Anna Sofia Nysten,female,22,0,0,7.75 -1,3,Mrs. Pekka Pietari (Elin Matilda Dolck) Hakkarainen,female,24,1,0,15.85 -0,3,Mr. Jeremiah Burke,male,19,0,0,6.75 -0,2,Mr. Edgardo Samuel Andrew,male,18,0,0,11.5 -0,2,Mr. Joseph Charles Nicholls,male,19,1,1,36.75 -1,3,Mr. August Edvard Andersson,male,27,0,0,7.7958 -0,3,Miss. Robina Maggie Ford,female,9,2,2,34.375 -0,2,Mr. Michel Navratil,male,36.5,0,2,26 -0,2,Rev. Thomas Roussel Davids Byles,male,42,0,0,13 -0,2,Rev. Robert James Bateman,male,51,0,0,12.525 -1,1,Mrs. Thomas (Edith Wearne) Pears,female,22,1,0,66.6 -0,3,Mr. Alfonzo Meo,male,55.5,0,0,8.05 -0,3,Mr. Austin Blyler van Billiard,male,40.5,0,2,14.5 -0,3,Mr. Ole Martin Olsen,male,27,0,0,7.3125 -0,1,Mr. Charles Duane Williams,male,51,0,1,61.3792 -1,3,Miss. Katherine Gilnagh,female,16,0,0,7.7333 -0,3,Mr. Harry Corn,male,30,0,0,8.05 -0,3,Mr. Mile Smiljanic,male,37,0,0,8.6625 -0,3,Master. Thomas Henry Sage,male,5,8,2,69.55 -0,3,Mr. John Hatfield Cribb,male,44,0,1,16.1 -1,2,Mrs. James (Elizabeth Inglis Milne) Watt,female,40,0,0,15.75 -0,3,Mr. John Viktor Bengtsson,male,26,0,0,7.775 -0,3,Mr. Jovo Calic,male,17,0,0,8.6625 -0,3,Master. Eino Viljami Panula,male,1,4,1,39.6875 -1,3,Master. Frank John William Goldsmith,male,9,0,2,20.525 -1,1,Mrs. (Edith Martha Bowerman) Chibnall,female,48,0,1,55 -0,3,Mrs. William (Anna Bernhardina Karlsson) Skoog,female,45,1,4,27.9 -0,1,Mr. John D Baumann,male,60,0,0,25.925 -0,3,Mr. Lee Ling,male,28,0,0,56.4958 -0,1,Mr. Wyckoff Van der hoef,male,61,0,0,33.5 -0,3,Master. Arthur Rice,male,4,4,1,29.125 -1,3,Miss. Eleanor Ileen Johnson,female,1,1,1,11.1333 -0,3,Mr. Antti Wilhelm Sivola,male,21,0,0,7.925 -0,1,Mr. James Clinch Smith,male,56,0,0,30.6958 -0,3,Mr. Klas Albin Klasen,male,18,1,1,7.8542 -0,3,Master. Henry Forbes Lefebre,male,5,3,1,25.4667 -0,1,Miss. Ann Elizabeth Isham,female,50,0,0,28.7125 -0,2,Mr. Reginald Hale,male,30,0,0,13 -0,3,Mr. Lionel Leonard,male,36,0,0,0 -0,3,Miss. Constance Gladys Sage,female,8,8,2,69.55 -0,2,Mr. Rene Pernot,male,39,0,0,15.05 -0,3,Master. Clarence Gustaf Hugo Asplund,male,9,4,2,31.3875 -1,2,Master. Richard F Becker,male,1,2,1,39 -1,3,Miss. Luise Gretchen Kink-Heilmann,female,4,0,2,22.025 -0,1,Mr. Hugh Roscoe Rood,male,39,0,0,50 -1,3,Mrs. Thomas (Johanna Godfrey) O'Brien,female,26,1,0,15.5 -1,1,Mr. Charles Hallace Romaine,male,45,0,0,26.55 -0,3,Mr. John Bourke,male,40,1,1,15.5 -0,3,Mr. Stjepan Turcin,male,36,0,0,7.8958 -1,2,Mrs. (Rosa) Pinsky,female,32,0,0,13 -0,2,Mr. William Carbines,male,19,0,0,13 -1,3,Miss. Carla Christine Nielsine Andersen-Jensen,female,19,1,0,7.8542 -1,2,Master. Michel M Navratil,male,3,1,1,26 -1,1,Mrs. James Joseph (Margaret Tobin) Brown,female,44,0,0,27.7208 -1,1,Miss. Elise Lurette,female,58,0,0,146.5208 -0,3,Mr. Robert Mernagh,male,28,0,0,7.75 -0,3,Mr. Karl Siegwart Andreas Olsen,male,42,0,1,8.4042 -1,3,Miss. Margaret Madigan,female,21,0,0,7.75 -0,2,Miss. Henriette Yrois,female,24,0,0,13 -0,3,Mr. Nestor Cyriel Vande Walle,male,28,0,0,9.5 -0,3,Mr. Frederick Sage,male,17,8,2,69.55 -0,3,Mr. Jakob Alfred Johanson,male,34,0,0,6.4958 -0,3,Mr. Gerious Youseff,male,45.5,0,0,7.225 -1,3,Mr. Gurshon Cohen,male,18,0,0,8.05 -0,3,Miss. Telma Matilda Strom,female,2,0,1,10.4625 -0,3,Mr. Karl Alfred Backstrom,male,32,1,0,15.85 -1,3,Mr. Nassef Cassem Albimona,male,26,0,0,18.7875 -1,3,Miss. Helen Carr,female,16,0,0,7.75 -1,1,Mr. Henry Blank,male,40,0,0,31 -0,3,Mr. Ahmed Ali,male,24,0,0,7.05 -1,2,Miss. Clear Annie Cameron,female,35,0,0,21 -0,3,Mr. John Henry Perkin,male,22,0,0,7.25 -0,2,Mr. Hans Kristensen Givard,male,30,0,0,13 -0,3,Mr. Philip Kiernan,male,22,1,0,7.75 -1,1,Miss. Madeleine Newell,female,31,1,0,113.275 -1,3,Miss. Eliina Honkanen,female,27,0,0,7.925 -0,2,Mr. Sidney Samuel Jacobsohn,male,42,1,0,27 -1,1,Miss. Albina Bazzani,female,32,0,0,76.2917 -0,2,Mr. Walter Harris,male,30,0,0,10.5 -1,3,Mr. Victor Francis Sunderland,male,16,0,0,8.05 -0,2,Mr. James H Bracken,male,27,0,0,13 -0,3,Mr. George Henry Green,male,51,0,0,8.05 -0,3,Mr. Christo Nenkoff,male,22,0,0,7.8958 -1,1,Mr. Frederick Maxfield Hoyt,male,38,1,0,90 -0,3,Mr. Karl Ivar Sven Berglund,male,22,0,0,9.35 -1,2,Mr. William John Mellors,male,19,0,0,10.5 -0,3,Mr. John Hall Lovell,male,20.5,0,0,7.25 -0,2,Mr. Arne Jonas Fahlstrom,male,18,0,0,13 -0,3,Miss. Mathilde Lefebre,female,12,3,1,25.4667 -1,1,Mrs. Henry Birkhardt (Irene Wallach) Harris,female,35,1,0,83.475 -0,3,Mr. Bengt Edvin Larsson,male,29,0,0,7.775 -0,2,Mr. Ernst Adolf Sjostedt,male,59,0,0,13.5 -1,3,Miss. Lillian Gertrud Asplund,female,5,4,2,31.3875 -0,2,Mr. Robert William Norman Leyson,male,24,0,0,10.5 -0,3,Miss. Alice Phoebe Harknett,female,21,0,0,7.55 -0,2,Mr. Stephen Hold,male,44,1,0,26 -1,2,Miss. Marjorie Collyer,female,8,0,2,26.25 -0,2,Mr. Frederick William Pengelly,male,19,0,0,10.5 -0,2,Mr. George Henry Hunt,male,33,0,0,12.275 -0,3,Miss. Thamine Zabour,female,19,1,0,14.4542 -1,3,Miss. Katherine Murphy,female,18,1,0,15.5 -0,2,Mr. Reginald Charles Coleridge,male,29,0,0,10.5 -0,3,Mr. Matti Alexanteri Maenpaa,male,22,0,0,7.125 -0,3,Mr. Sleiman Attalah,male,30,0,0,7.225 -0,1,Dr. William Edward Minahan,male,44,2,0,90 -0,3,Miss. Agda Thorilda Viktoria Lindahl,female,25,0,0,7.775 -1,2,Mrs. William (Anna) Hamalainen,female,24,0,2,14.5 -1,1,Mr. Richard Leonard Beckwith,male,37,1,1,52.5542 -0,2,Rev. Ernest Courtenay Carter,male,54,1,0,26 -0,3,Mr. James George Reed,male,18,0,0,7.25 -0,3,Mrs. Wilhelm (Elna Matilda Persson) Strom,female,29,1,1,10.4625 -0,1,Mr. William Thomas Stead,male,62,0,0,26.55 -0,3,Mr. William Arthur Lobb,male,30,1,0,16.1 -0,3,Mrs. Viktor (Helena Wilhelmina) Rosblom,female,41,0,2,20.2125 -1,3,Mrs. Darwis (Hanne Youssef Razi) Touma,female,29,0,2,15.2458 -1,1,Mrs. Gertrude Maybelle Thorne,female,38,0,0,79.2 -1,1,Miss. Gladys Cherry,female,30,0,0,86.5 -1,1,Miss. Anna Ward,female,35,0,0,512.3292 -1,2,Mrs. (Lutie Davis) Parrish,female,50,0,1,26 -1,3,Master. Edvin Rojj Felix Asplund,male,3,4,2,31.3875 -0,1,Mr. Emil Taussig,male,52,1,1,79.65 -0,1,Mr. William Harrison,male,40,0,0,0 -0,3,Miss. Delia Henry,female,21,0,0,7.75 -0,2,Mr. David Reeves,male,36,0,0,10.5 -0,3,Mr. Ernesti Arvid Panula,male,16,4,1,39.6875 -1,3,Mr. Ernst Ulrik Persson,male,25,1,0,7.775 -1,1,Mrs. William Thompson (Edith Junkins) Graham,female,58,0,1,153.4625 -1,1,Miss. Amelia Bissette,female,35,0,0,135.6333 -0,1,Mr. Alexander Cairns,male,28,0,0,31 -1,3,Mr. William Henry Tornquist,male,25,0,0,0 -1,2,Mrs. (Elizabeth Anne Maidment) Mellinger,female,41,0,1,19.5 -0,1,Mr. Charles H Natsch,male,37,0,1,29.7 -1,3,Miss. Hanora Healy,female,33,0,0,7.75 -1,1,Miss. Kornelia Theodosia Andrews,female,63,1,0,77.9583 -0,3,Miss. Augusta Charlotta Lindblom,female,45,0,0,7.75 -0,2,Mr. Francis Parkes,male,21,0,0,0 -0,3,Master. Eric Rice,male,7,4,1,29.125 -1,3,Mrs. Stanton (Rosa Hunt) Abbott,female,35,1,1,20.25 -0,3,Mr. Frank Duane,male,65,0,0,7.75 -0,3,Mr. Nils Johan Goransson Olsson,male,28,0,0,7.8542 -0,3,Mr. Alfons de Pelsmaeker,male,16,0,0,9.5 -1,3,Mr. Edward Arthur Dorking,male,19,0,0,8.05 -0,1,Mr. Richard William Smith,male,57,0,0,26 -0,3,Mr. Ivan Stankovic,male,33,0,0,8.6625 -1,3,Mr. Theodore de Mulder,male,30,0,0,9.5 -0,3,Mr. Penko Naidenoff,male,22,0,0,7.8958 -1,2,Mr. Masabumi Hosono,male,42,0,0,13 -1,3,Miss. Kate Connolly,female,22,0,0,7.75 -1,1,Miss. Ellen Barber,female,26,0,0,78.85 -1,1,Mrs. Dickinson H (Helen Walton) Bishop,female,19,1,0,91.0792 -0,2,Mr. Rene Jacques Levy,male,36,0,0,12.875 -0,3,Miss. Aloisia Haas,female,24,0,0,8.85 -0,3,Mr. Ivan Mineff,male,24,0,0,7.8958 -0,1,Mr. Ervin G Lewy,male,30,0,0,27.7208 -0,3,Mr. Mansour Hanna,male,23.5,0,0,7.2292 -0,1,Miss. Helen Loraine Allison,female,2,1,2,151.55 -1,1,Mr. Adolphe Saalfeld,male,47,0,0,30.5 -1,1,Mrs. James (Helene DeLaudeniere Chaput) Baxter,female,50,0,1,247.5208 -1,3,Miss. Anna Katherine Kelly,female,20,0,0,7.75 -1,3,Mr. Bernard McCoy,male,24,2,0,23.25 -0,3,Mr. William Cahoone Jr Johnson,male,19,0,0,0 -1,2,Miss. Nora A Keane,female,46,0,0,12.35 -0,3,Mr. Howard Hugh Williams,male,28,0,0,8.05 -1,1,Master. Hudson Trevor Allison,male,0.92,1,2,151.55 -1,1,Miss. Margaret Fleming,female,42,0,0,110.8833 -1,1,Mrs. Victor de Satode (Maria Josefa Perez de Soto y Vallejo) Penasco y Castellana,female,17,1,0,108.9 -0,2,Mr. Samuel Abelson,male,30,1,0,24 -1,1,Miss. Laura Mabel Francatelli,female,30,0,0,56.9292 -1,1,Miss. Margaret Bechstein Hays,female,24,0,0,83.1583 -1,1,Miss. Emily Borie Ryerson,female,18,2,2,262.375 -0,2,Mrs. William (Anna Sylfven) Lahtinen,female,26,1,1,26 -0,3,Mr. Ignjac Hendekovic,male,28,0,0,7.8958 -0,2,Mr. Benjamin Hart,male,43,1,1,26.25 -1,3,Miss. Helmina Josefina Nilsson,female,26,0,0,7.8542 -1,2,Mrs. Sinai (Miriam Sternin) Kantor,female,24,1,0,26 -0,2,Dr. Ernest Moraweck,male,54,0,0,14 -1,1,Miss. Mary Natalie Wick,female,31,0,2,164.8667 -1,1,Mrs. Frederic Oakley (Margaretta Corning Stone) Spedden,female,40,1,1,134.5 -0,3,Mr. Samuel Dennis,male,22,0,0,7.25 -0,3,Mr. Yoto Danoff,male,27,0,0,7.8958 -1,2,Miss. Hilda Mary Slayter,female,30,0,0,12.35 -1,2,Mrs. Albert Francis (Sylvia Mae Harbaugh) Caldwell,female,22,1,1,29 -0,3,Mr. George John Jr Sage,male,20,8,2,69.55 -1,1,Miss. Marie Grice Young,female,36,0,0,135.6333 -0,3,Mr. Johan Hansen Nysveen,male,61,0,0,6.2375 -1,2,Mrs. (Ada E Hall) Ball,female,36,0,0,13 -1,3,Mrs. Frank John (Emily Alice Brown) Goldsmith,female,31,1,1,20.525 -1,1,Miss. Jean Gertrude Hippach,female,16,0,1,57.9792 -1,3,Miss. Agnes McCoy,female,28,2,0,23.25 -0,1,Mr. Austen Partner,male,45.5,0,0,28.5 -0,1,Mr. George Edward Graham,male,38,0,1,153.4625 -0,3,Mr. Leo Edmondus Vander Planke,male,16,2,0,18 -1,1,Mrs. Henry William (Clara Heinsheimer) Frauenthal,female,42,1,0,133.65 -0,3,Mr. Mitto Denkoff,male,30,0,0,7.8958 -0,1,Mr. Thomas Clinton Pears,male,29,1,0,66.6 -1,1,Miss. Elizabeth Margaret Burns,female,41,0,0,134.5 -1,3,Mr. Karl Edwart Dahl,male,45,0,0,8.05 -0,1,Mr. Stephen Weart Blackwell,male,45,0,0,35.5 -1,2,Master. Edmond Roger Navratil,male,2,1,1,26 -1,1,Miss. Alice Elizabeth Fortune,female,24,3,2,263 -0,2,Mr. Erik Gustaf Collander,male,28,0,0,13 -0,2,Mr. Charles Frederick Waddington Sedgwick,male,25,0,0,13 -0,2,Mr. Stanley Hubert Fox,male,36,0,0,13 -1,2,Miss. Amelia Brown,female,24,0,0,13 -1,2,Miss. Marion Elsie Smith,female,40,0,0,13 -1,3,Mrs. Thomas Henry (Mary E Finck) Davison,female,34,1,0,16.1 -1,3,Master. William Loch Coutts,male,3,1,1,15.9 -0,3,Mr. Jovan Dimic,male,42,0,0,8.6625 -0,3,Mr. Nils Martin Odahl,male,23,0,0,9.225 -0,1,Mr. Fletcher Fellows Williams-Lambert,male,43,0,0,35 -0,3,Mr. Tannous Elias,male,15,1,1,7.2292 -0,3,Mr. Josef Arnold-Franchi,male,25,1,0,17.8 -0,3,Mr. Wazli Yousif,male,23,0,0,7.225 -0,3,Mr. Leo Peter Vanden Steen,male,28,0,0,9.5 -1,1,Miss. Elsie Edith Bowerman,female,22,0,1,55 -0,2,Miss. Annie Clemmer Funk,female,38,0,0,13 -1,3,Miss. Mary McGovern,female,22,0,0,7.8792 -1,3,Miss. Helen Mary Mockler,female,23,0,0,7.8792 -0,3,Mr. Wilhelm Skoog,male,40,1,4,27.9 -0,2,Mr. Sebastiano del Carlo,male,29,1,0,27.7208 -0,3,Mrs. (Catherine David) Barbara,female,45,0,1,14.4542 -0,3,Mr. Adola Asim,male,35,0,0,7.05 -0,3,Mr. Thomas O'Brien,male,27,1,0,15.5 -0,3,Mr. Mauritz Nils Martin Adahl,male,30,0,0,7.25 -1,1,Mrs. Frank Manley (Anna Sophia Atkinson) Warren,female,60,1,0,75.25 -1,3,Mrs. (Mantoura Boulos) Moussa,female,35,0,0,7.2292 -1,3,Miss. Annie Jermyn,female,22,0,0,7.75 -1,1,Mme. Leontine Pauline Aubart,female,24,0,0,69.3 -1,1,Mr. George Achilles Harder,male,25,1,0,55.4417 -0,3,Mr. Jakob Alfred Wiklund,male,18,1,0,6.4958 -0,3,Mr. William Thomas Beavan,male,19,0,0,8.05 -0,1,Mr. Sante Ringhini,male,22,0,0,135.6333 -0,3,Miss. Stina Viola Palsson,female,3,3,1,21.075 -1,1,Mrs. Edgar Joseph (Leila Saks) Meyer,female,25,1,0,82.1708 -1,3,Miss. Aurora Adelia Landergren,female,22,0,0,7.25 -0,1,Mr. Harry Elkins Widener,male,27,0,2,211.5 -0,3,Mr. Tannous Betros,male,20,0,0,4.0125 -0,3,Mr. Karl Gideon Gustafsson,male,19,0,0,7.775 -1,1,Miss. Rosalie Bidois,female,42,0,0,227.525 -1,3,Miss. Maria Nakid,female,1,0,2,15.7417 -0,3,Mr. Juho Tikkanen,male,32,0,0,7.925 -1,1,Mrs. Alexander Oskar (Mary Aline Towner) Holverson,female,35,1,0,52 -0,3,Mr. Vasil Plotcharsky,male,27,0,0,7.8958 -0,2,Mr. Charles Henry Davies,male,18,0,0,73.5 -0,3,Master. Sidney Leonard Goodwin,male,1,5,2,46.9 -1,2,Miss. Kate Buss,female,36,0,0,13 -0,3,Mr. Matthew Sadlier,male,19,0,0,7.7292 -1,2,Miss. Bertha Lehmann,female,17,0,0,12 -1,1,Mr. William Ernest Carter,male,36,1,2,120 -1,3,Mr. Carl Olof Jansson,male,21,0,0,7.7958 -0,3,Mr. Johan Birger Gustafsson,male,28,2,0,7.925 -1,1,Miss. Marjorie Newell,female,23,1,0,113.275 -1,3,Mrs. Hjalmar (Agnes Charlotta Bengtsson) Sandstrom,female,24,0,2,16.7 -0,3,Mr. Erik Johansson,male,22,0,0,7.7958 -0,3,Miss. Elina Olsson,female,31,0,0,7.8542 -0,2,Mr. Peter David McKane,male,46,0,0,26 -0,2,Dr. Alfred Pain,male,23,0,0,10.5 -1,2,Mrs. William H (Jessie L) Trout,female,28,0,0,12.65 -1,3,Mr. Juha Niskanen,male,39,0,0,7.925 -0,3,Mr. John Adams,male,26,0,0,8.05 -0,3,Miss. Mari Aina Jussila,female,21,1,0,9.825 -0,3,Mr. Pekka Pietari Hakkarainen,male,28,1,0,15.85 -0,3,Miss. Marija Oreskovic,female,20,0,0,8.6625 -0,2,Mr. Shadrach Gale,male,34,1,0,21 -0,3,Mr. Carl/Charles Peter Widegren,male,51,0,0,7.75 -1,2,Master. William Rowe Richards,male,3,1,1,18.75 -0,3,Mr. Hans Martin Monsen Birkeland,male,21,0,0,7.775 -0,3,Miss. Ida Lefebre,female,3,3,1,25.4667 -0,3,Mr. Todor Sdycoff,male,42,0,0,7.8958 -0,3,Mr. Henry Hart,male,27,0,0,6.8583 -1,1,Miss. Daisy E Minahan,female,33,1,0,90 -0,2,Mr. Alfred Fleming Cunningham,male,22,0,0,0 -1,3,Mr. Johan Julian Sundman,male,44,0,0,7.925 -0,3,Mrs. Thomas (Annie Louise Rowley) Meek,female,32,0,0,8.05 -1,2,Mrs. James Vivian (Lulu Thorne Christian) Drew,female,34,1,1,32.5 -1,2,Miss. Lyyli Karoliina Silven,female,18,0,2,13 -0,2,Mr. William John Matthews,male,30,0,0,13 -0,3,Miss. Catharina Van Impe,female,10,0,2,24.15 -0,3,Mr. David Charters,male,21,0,0,7.7333 -0,3,Mr. Leo Zimmerman,male,29,0,0,7.875 -0,3,Mrs. Ernst Gilbert (Anna Sigrid Maria Brogren) Danbom,female,28,1,1,14.4 -0,3,Mr. Viktor Richard Rosblom,male,18,1,1,20.2125 -0,3,Mr. Phillippe Wiseman,male,54,0,0,7.25 -1,2,Mrs. Charles V (Ada Maria Winfield) Clarke,female,28,1,0,26 -1,2,Miss. Kate Florence Phillips,female,19,0,0,26 -0,3,Mr. James Flynn,male,28,0,0,7.75 -1,3,Mr. Berk (Berk Trembisky) Pickard,male,32,0,0,8.05 -1,1,Mr. Mauritz Hakan Bjornstrom-Steffansson,male,28,0,0,26.55 -1,3,Mrs. Percival (Florence Kate White) Thorneycroft,female,33,1,0,16.1 -1,2,Mrs. Charles Alexander (Alice Adelaide Slow) Louch,female,42,1,0,26 -0,3,Mr. Nikolai Erland Kallio,male,17,0,0,7.125 -0,1,Mr. William Baird Silvey,male,50,1,0,55.9 -1,1,Miss. Lucile Polk Carter,female,14,1,2,120 -0,3,Miss. Doolina Margaret Ford,female,21,2,2,34.375 -1,2,Mrs. Sidney (Emily Hocking) Richards,female,24,2,3,18.75 -0,1,Mr. Mark Fortune,male,64,1,4,263 -0,2,Mr. Johan Henrik Johannesson Kvillner,male,31,0,0,10.5 -1,2,Mrs. Benjamin (Esther Ada Bloomfield) Hart,female,45,1,1,26.25 -0,3,Mr. Leon Hampe,male,20,0,0,9.5 -0,3,Mr. Johan Emil Petterson,male,25,1,0,7.775 -1,2,Ms. Encarnacion Reynaldo,female,28,0,0,13 -1,3,Mr. Bernt Johannesen-Bratthammer,male,29,0,0,8.1125 -1,1,Master. Washington Dodge,male,4,0,2,81.8583 -1,2,Miss. Madeleine Violet Mellinger,female,13,0,1,19.5 -1,1,Mr. Frederic Kimber Seward,male,34,0,0,26.55 -1,3,Miss. Marie Catherine Baclini,female,5,2,1,19.2583 -1,1,Major. Arthur Godfrey Peuchen,male,52,0,0,30.5 -0,2,Mr. Edwy Arthur West,male,36,1,2,27.75 -0,3,Mr. Ingvald Olai Olsen Hagland,male,28,1,0,19.9667 -0,1,Mr. Benjamin Laventall Foreman,male,30,0,0,27.75 -1,1,Mr. Samuel L Goldenberg,male,49,1,0,89.1042 -0,3,Mr. Joseph Peduzzi,male,24,0,0,8.05 -1,3,Mr. Ivan Jalsevac,male,29,0,0,7.8958 -0,1,Mr. Francis Davis Millet,male,65,0,0,26.55 -1,1,Mrs. Frederick R (Marion) Kenyon,female,41,1,0,51.8625 -1,2,Miss. Ellen Toomey,female,50,0,0,10.5 -0,3,Mr. Maurice O'Connor,male,17,0,0,7.75 -1,1,Mr. Harry Anderson,male,48,0,0,26.55 -0,3,Mr. William Morley,male,34,0,0,8.05 -0,1,Mr. Arthur H Gee,male,47,0,0,38.5 -0,2,Mr. Jacob Christian Milling,male,48,0,0,13 -0,3,Mr. Simon Maisner,male,34,0,0,8.05 -0,3,Mr. Manuel Estanslas Goncalves,male,38,0,0,7.05 -0,2,Mr. William Campbell,male,21,0,0,0 -0,1,Mr. John Montgomery Smart,male,56,0,0,26.55 -0,3,Mr. James Scanlan,male,22,0,0,7.725 -1,3,Miss. Helene Barbara Baclini,female,0.75,2,1,19.2583 -0,3,Mr. Arthur Keefe,male,39,0,0,7.25 -0,3,Mr. Luka Cacic,male,38,0,0,8.6625 -1,2,Mrs. Edwy Arthur (Ada Mary Worth) West,female,33,1,2,27.75 -1,2,Mrs. Amin S (Marie Marthe Thuillard) Jerwan,female,23,0,0,13.7917 -0,3,Miss. Ida Sofia Strandberg,female,22,0,0,9.8375 -0,1,Mr. George Quincy Clifford,male,40,0,0,52 -0,2,Mr. Peter Henry Renouf,male,34,1,0,21 -0,3,Mr. Lewis Richard Braund,male,29,1,0,7.0458 -0,3,Mr. Nils August Karlsson,male,22,0,0,7.5208 -1,3,Miss. Hildur E Hirvonen,female,2,0,1,12.2875 -0,3,Master. Harold Victor Goodwin,male,9,5,2,46.9 -0,2,Mr. Anthony Wood Frost,male,37,0,0,0 -0,3,Mr. Richard Henry Rouse,male,50,0,0,8.05 -1,3,Mrs. (Hedwig) Turkula,female,63,0,0,9.5875 -1,1,Mr. Dickinson H Bishop,male,25,1,0,91.0792 -0,3,Miss. Jeannie Lefebre,female,8,3,1,25.4667 -1,1,Mrs. Frederick Maxfield (Jane Anne Forby) Hoyt,female,35,1,0,90 -0,1,Mr. Edward Austin Kent,male,58,0,0,29.7 -0,3,Mr. Francis William Somerton,male,30,0,0,8.05 -1,3,Master. Eden Leslie Coutts,male,9,1,1,15.9 -0,3,Mr. Konrad Mathias Reiersen Hagland,male,19,1,0,19.9667 -0,3,Mr. Einar Windelov,male,21,0,0,7.25 -0,1,Mr. Harry Markland Molson,male,55,0,0,30.5 -0,1,Mr. Ramon Artagaveytia,male,71,0,0,49.5042 -0,3,Mr. Edward Roland Stanley,male,21,0,0,8.05 -0,3,Mr. Gerious Yousseff,male,26,0,0,14.4583 -1,1,Miss. Elizabeth Mussey Eustis,female,54,1,0,78.2667 -0,3,Mr. Frederick William Shellard,male,55,0,0,15.1 -0,1,Mrs. Hudson J C (Bessie Waldo Daniels) Allison,female,25,1,2,151.55 -0,3,Mr. Olof Svensson,male,24,0,0,7.7958 -0,3,Mr. Petar Calic,male,17,0,0,8.6625 -0,3,Miss. Mary Canavan,female,21,0,0,7.75 -0,3,Miss. Bridget Mary O'Sullivan,female,21,0,0,7.6292 -0,3,Miss. Kristina Sofia Laitinen,female,37,0,0,9.5875 -1,1,Miss. Roberta Maioni,female,16,0,0,86.5 -0,1,Mr. Victor de Satode Penasco y Castellana,male,18,1,0,108.9 -1,2,Mrs. Frederick Charles (Jane Richards) Quick,female,33,0,2,26 -1,1,Mr. George Bradley,male,37,0,0,26.55 -0,3,Mr. Henry Margido Olsen,male,28,0,0,22.525 -1,3,Mr. Fang Lang,male,26,0,0,56.4958 -1,3,Mr. Eugene Patrick Daly,male,29,0,0,7.75 -0,3,Mr. James Webber,male,66,0,0,8.05 -1,1,Mr. James Robert McGough,male,36,0,0,26.2875 -1,1,Mrs. Martin (Elizabeth L. Barrett) Rothschild,female,54,1,0,59.4 -0,3,Mr. Satio Coleff,male,24,0,0,7.4958 -0,1,Mr. William Anderson Walker,male,47,0,0,34.0208 -1,2,Mrs. (Amelia Milley) Lemore,female,34,0,0,10.5 -0,3,Mr. Patrick Ryan,male,30,0,0,24.15 -1,2,Mrs. William A (Florence Agnes Hughes) Angle,female,36,1,0,26 -0,3,Mr. Stefo Pavlovic,male,32,0,0,7.8958 -1,1,Miss. Anne Perreault,female,30,0,0,93.5 -0,3,Mr. Janko Vovk,male,22,0,0,7.8958 -0,3,Mr. Sarkis Lahoud,male,35,0,0,7.225 -1,1,Mrs. Louis Albert (Ida Sophia Fischer) Hippach,female,44,0,1,57.9792 -0,3,Mr. Fared Kassem,male,18,0,0,7.2292 -0,3,Mr. James Farrell,male,40.5,0,0,7.75 -1,2,Miss. Lucy Ridsdale,female,50,0,0,10.5 -0,1,Mr. John Farthing,male,49,0,0,221.7792 -0,3,Mr. Johan Werner Salonen,male,39,0,0,7.925 -0,2,Mr. Richard George Hocking,male,23,2,1,11.5 -1,2,Miss. Phyllis May Quick,female,2,1,1,26 -0,3,Mr. Nakli Toufik,male,17,0,0,7.2292 -0,3,Mr. Joseph Jr Elias,male,17,1,1,7.2292 -1,3,Mrs. Catherine (Catherine Rizk) Peter,female,24,0,2,22.3583 -0,3,Miss. Marija Cacic,female,30,0,0,8.6625 -1,2,Miss. Eva Miriam Hart,female,7,0,2,26.25 -0,1,Major. Archibald Willingham Butt,male,45,0,0,26.55 -1,1,Miss. Bertha LeRoy,female,30,0,0,106.425 -0,3,Mr. Samuel Beard Risien,male,69,0,0,14.5 -1,1,Miss. Hedwig Margaritha Frolicher,female,22,0,2,49.5 -1,1,Miss. Harriet R Crosby,female,36,0,2,71 -0,3,Miss. Ingeborg Constanzia Andersson,female,9,4,2,31.275 -0,3,Miss. Sigrid Elisabeth Andersson,female,11,4,2,31.275 -1,2,Mr. Edward Beane,male,32,1,0,26 -0,1,Mr. Walter Donald Douglas,male,50,1,0,106.425 -0,1,Mr. Arthur Ernest Nicholson,male,64,0,0,26 -1,2,Mrs. Edward (Ethel Clarke) Beane,female,19,1,0,26 -1,2,Mr. Julian Padro y Manent,male,27,0,0,13.8625 -0,3,Mr. Frank John Goldsmith,male,33,1,1,20.525 -1,2,Master. John Morgan Jr Davies,male,8,1,1,36.75 -1,1,Mr. John Borland Jr Thayer,male,17,0,2,110.8833 -0,2,Mr. Percival James R Sharp,male,27,0,0,26 -0,3,Mr. Timothy O'Brien,male,21,0,0,7.8292 -1,3,Mr. Fahim Leeni,male,22,0,0,7.225 -1,3,Miss. Velin Ohman,female,22,0,0,7.775 -0,1,Mr. George Wright,male,62,0,0,26.55 -1,1,Lady. (Lucille Christiana Sutherland)Duff Gordon,female,48,1,0,39.6 -0,1,Mr. Victor Robbins,male,45,0,0,227.525 -1,1,Mrs. Emil (Tillie Mandelbaum) Taussig,female,39,1,1,79.65 -1,3,Mrs. Guillaume Joseph (Emma) de Messemaeker,female,36,1,0,17.4 -0,3,Mr. Thomas Rowan Morrow,male,30,0,0,7.75 -0,3,Mr. Husein Sivic,male,40,0,0,7.8958 -0,2,Mr. Robert Douglas Norman,male,28,0,0,13.5 -0,3,Mr. John Simmons,male,40,0,0,8.05 -0,3,Miss. (Marion Ogden) Meanwell,female,62,0,0,8.05 -0,3,Mr. Alfred J Davies,male,24,2,0,24.15 -0,3,Mr. Ilia Stoytcheff,male,19,0,0,7.8958 -0,3,Mrs. Nils (Alma Cornelia Berglund) Palsson,female,29,0,4,21.075 -0,3,Mr. Tannous Doharr,male,28,0,0,7.2292 -1,3,Mr. Carl Jonsson,male,32,0,0,7.8542 -1,2,Mr. George Harris,male,62,0,0,10.5 -1,1,Mrs. Edward Dale (Charlotte Lamson) Appleton,female,53,2,0,51.4792 -1,1,Mr. John Irwin Flynn,male,36,0,0,26.3875 -1,3,Miss. Mary Kelly,female,22,0,0,7.75 -0,3,Mr. Alfred George John Rush,male,16,0,0,8.05 -0,3,Mr. George Patchett,male,19,0,0,14.5 -1,2,Miss. Ethel Garside,female,34,0,0,13 -1,1,Mrs. William Baird (Alice Munger) Silvey,female,39,1,0,55.9 -0,3,Mrs. Joseph (Maria Elias) Caram,female,18,1,0,14.4583 -1,3,Mr. Eiriik Jussila,male,32,0,0,7.925 -1,2,Miss. Julie Rachel Christy,female,25,1,1,30 -1,1,Mrs. John Borland (Marian Longstreth Morris) Thayer,female,39,1,1,110.8833 -0,2,Mr. William James Downton,male,54,0,0,26 -0,1,Mr. John Hugo Ross,male,36,0,0,40.125 -0,3,Mr. Uscher Paulner,male,16,0,0,8.7125 -1,1,Miss. Ruth Taussig,female,18,0,2,79.65 -0,2,Mr. John Denzil Jarvis,male,47,0,0,15 -1,1,Mr. Maxmillian Frolicher-Stehli,male,60,1,1,79.2 -0,3,Mr. Eliezer Gilinski,male,22,0,0,8.05 -0,3,Mr. Joseph Murdlin,male,22,0,0,8.05 -0,3,Mr. Matti Rintamaki,male,35,0,0,7.125 -1,1,Mrs. Walter Bertram (Martha Eustis) Stephenson,female,52,1,0,78.2667 -0,3,Mr. William James Elsbury,male,47,0,0,7.25 -0,3,Miss. Mary Bourke,female,40,0,2,7.75 -0,2,Mr. John Henry Chapman,male,37,1,0,26 -0,3,Mr. Jean Baptiste Van Impe,male,36,1,1,24.15 -1,2,Miss. Jessie Wills Leitch,female,31,0,0,33 -0,3,Mr. Alfred Johnson,male,49,0,0,0 -0,3,Mr. Hanna Boulos,male,18,0,0,7.225 -1,1,Sir. Cosmo Edmund Duff Gordon,male,49,1,0,56.9292 -1,2,Mrs. Sidney Samuel (Amy Frances Christy) Jacobsohn,female,24,2,1,27 -0,3,Mr. Petco Slabenoff,male,42,0,0,7.8958 -0,1,Mr. Charles H Harrington,male,37,0,0,42.4 -0,3,Mr. Ernst William Torber,male,44,0,0,8.05 -1,1,Mr. Harry Homer,male,35,0,0,26.55 -0,3,Mr. Edvard Bengtsson Lindell,male,36,1,0,15.55 -0,3,Mr. Milan Karaic,male,30,0,0,7.8958 -1,1,Mr. Robert Williams Daniel,male,27,0,0,30.5 -1,2,Mrs. Joseph (Juliette Marie Louise Lafargue) Laroche,female,22,1,2,41.5792 -1,1,Miss. Elizabeth W Shutes,female,40,0,0,153.4625 -0,3,Mrs. Anders Johan (Alfrida Konstantia Brogren) Andersson,female,39,1,5,31.275 -0,3,Mr. Jose Neto Jardin,male,21,0,0,7.05 -1,3,Miss. Margaret Jane Murphy,female,18,1,0,15.5 -0,3,Mr. John Horgan,male,22,0,0,7.75 -0,3,Mr. William Alfred Brocklebank,male,35,0,0,8.05 -1,2,Miss. Alice Herman,female,24,1,2,65 -0,3,Mr. Ernst Gilbert Danbom,male,34,1,1,14.4 -0,3,Mrs. William Arthur (Cordelia K Stanlick) Lobb,female,26,1,0,16.1 -1,2,Miss. Marion Louise Becker,female,4,2,1,39 -0,2,Mr. Lawrence Gavey,male,26,0,0,10.5 -0,3,Mr. Antoni Yasbeck,male,27,1,0,14.4542 -1,1,Mr. Edwin Nelson Jr Kimball,male,42,1,0,52.5542 -1,3,Mr. Sahid Nakid,male,20,1,1,15.7417 -0,3,Mr. Henry Damsgaard Hansen,male,21,0,0,7.8542 -0,3,Mr. David John Bowen,male,21,0,0,16.1 -0,1,Mr. Frederick Sutton,male,61,0,0,32.3208 -0,2,Rev. Charles Leonard Kirkland,male,57,0,0,12.35 -1,1,Miss. Gretchen Fiske Longley,female,21,0,0,77.9583 -0,3,Mr. Guentcho Bostandyeff,male,26,0,0,7.8958 -0,3,Mr. Patrick D O'Connell,male,18,0,0,7.7333 -1,1,Mr. Algernon Henry Wilson Barkworth,male,80,0,0,30 -0,3,Mr. Johan Svensson Lundahl,male,51,0,0,7.0542 -1,1,Dr. Max Stahelin-Maeglin,male,32,0,0,30.5 -0,1,Mr. William Henry Marsh Parr,male,30,0,0,0 -0,3,Miss. Mabel Skoog,female,9,3,2,27.9 -1,2,Miss. Mary Davis,female,28,0,0,13 -0,3,Mr. Antti Gustaf Leinonen,male,32,0,0,7.925 -0,2,Mr. Harvey Collyer,male,31,1,1,26.25 -0,3,Mrs. Juha (Maria Emilia Ojala) Panula,female,41,0,5,39.6875 -0,3,Mr. Percival Thorneycroft,male,37,1,0,16.1 -0,3,Mr. Hans Peder Jensen,male,20,0,0,7.8542 -1,1,Mlle. Emma Sagesser,female,24,0,0,69.3 -0,3,Miss. Margit Elizabeth Skoog,female,2,3,2,27.9 -1,3,Mr. Choong Foo,male,32,0,0,56.4958 -1,3,Miss. Eugenie Baclini,female,0.75,2,1,19.2583 -1,1,Mr. Henry Sleeper Harper,male,48,1,0,76.7292 -0,3,Mr. Liudevit Cor,male,19,0,0,7.8958 -1,1,Col. Oberst Alfons Simonius-Blumer,male,56,0,0,35.5 -0,3,Mr. Edward Willey,male,21,0,0,7.55 -1,3,Miss. Amy Zillah Elsie Stanley,female,23,0,0,7.55 -0,3,Mr. Mito Mitkoff,male,23,0,0,7.8958 -1,2,Miss. Elsie Doling,female,18,0,1,23 -0,3,Mr. Johannes Halvorsen Kalvik,male,21,0,0,8.4333 -1,3,Miss. Hanora O'Leary,female,16,0,0,7.8292 -0,3,Miss. Hanora Hegarty,female,18,0,0,6.75 -0,2,Mr. Leonard Mark Hickman,male,24,2,0,73.5 -0,3,Mr. Alexander Radeff,male,27,0,0,7.8958 -0,3,Mrs. John (Catherine) Bourke,female,32,1,1,15.5 -0,2,Mr. George Floyd Eitemiller,male,23,0,0,13 -0,1,Mr. Arthur Webster Newell,male,58,0,2,113.275 -1,1,Dr. Henry William Frauenthal,male,50,2,0,133.65 -0,3,Mr. Mohamed Badt,male,40,0,0,7.225 -0,1,Mr. Edward Pomeroy Colley,male,47,0,0,25.5875 -0,3,Mr. Peju Coleff,male,36,0,0,7.4958 -1,3,Mr. Eino William Lindqvist,male,20,1,0,7.925 -0,2,Mr. Lewis Hickman,male,32,2,0,73.5 -0,2,Mr. Reginald Fenton Butler,male,25,0,0,13 -0,3,Mr. Knud Paust Rommetvedt,male,49,0,0,7.775 -0,3,Mr. Jacob Cook,male,43,0,0,8.05 -1,1,Mrs. Elmer Zebley (Juliet Cummins Wright) Taylor,female,48,1,0,52 -1,2,Mrs. Thomas William Solomon (Elizabeth Catherine Ford) Brown,female,40,1,1,39 -0,1,Mr. Thornton Davidson,male,31,1,0,52 -0,2,Mr. Henry Michael Mitchell,male,70,0,0,10.5 -1,2,Mr. Charles Wilhelms,male,31,0,0,13 -0,2,Mr. Ennis Hastings Watson,male,19,0,0,0 -0,3,Mr. Gustaf Hjalmar Edvardsson,male,18,0,0,7.775 -0,3,Mr. Frederick Charles Sawyer,male,24.5,0,0,8.05 -1,3,Miss. Anna Sofia Turja,female,18,0,0,9.8417 -0,3,Mrs. Frederick (Augusta Tyler) Goodwin,female,43,1,6,46.9 -1,1,Mr. Thomas Drake Martinez Cardeza,male,36,0,1,512.3292 -0,3,Miss. Katie Peters,female,28,0,0,8.1375 -1,1,Mr. Hammad Hassab,male,27,0,0,76.7292 -0,3,Mr. Thor Anderson Olsvigen,male,20,0,0,9.225 -0,3,Mr. Charles Edward Goodwin,male,14,5,2,46.9 -0,2,Mr. Thomas William Solomon Brown,male,60,1,1,39 -0,2,Mr. Joseph Philippe Lemercier Laroche,male,25,1,2,41.5792 -0,3,Mr. Jaako Arnold Panula,male,14,4,1,39.6875 -0,3,Mr. Branko Dakic,male,19,0,0,10.1708 -0,3,Mr. Eberhard Thelander Fischer,male,18,0,0,7.7958 -1,1,Miss. Georgette Alexandra Madill,female,15,0,1,211.3375 -1,1,Mr. Albert Adrian Dick,male,31,1,0,57 -1,3,Miss. Manca Karun,female,4,0,1,13.4167 -1,3,Mr. Ali Lam,male,37,0,0,56.4958 -0,3,Mr. Khalil Saad,male,25,0,0,7.225 -0,1,Col. John Weir,male,60,0,0,26.55 -0,2,Mr. Charles Henry Chapman,male,52,0,0,13.5 -0,3,Mr. James Kelly,male,44,0,0,8.05 -1,3,Miss. Katherine Mullens,female,19,0,0,7.7333 -0,1,Mr. John Borland Thayer,male,49,1,1,110.8833 -0,3,Mr. Adolf Mathias Nicolai Olsen Humblen,male,42,0,0,7.65 -1,1,Mrs. John Jacob (Madeleine Talmadge Force) Astor,female,18,1,0,227.525 -1,1,Mr. Spencer Victor Silverthorne,male,35,0,0,26.2875 -0,3,Miss. Saiide Barbara,female,18,0,1,14.4542 -0,3,Mr. Martin Gallagher,male,25,0,0,7.7417 -0,3,Mr. Henrik Juul Hansen,male,26,1,0,7.8542 -0,2,Mr. Henry Samuel Morley,male,39,0,0,26 -1,2,Mrs. Florence Kelly,female,45,0,0,13.5 -1,1,Mr. Edward Pennington Calderhead,male,42,0,0,26.2875 -1,1,Miss. Alice Cleaver,female,22,0,0,151.55 -1,3,Master. Halim Gonios Moubarek,male,4,1,1,15.2458 -1,1,Mlle. Berthe Antonine Mayne,female,24,0,0,49.5042 -0,1,Mr. Herman Klaber,male,41,0,0,26.55 -1,1,Mr. Elmer Zebley Taylor,male,48,1,0,52 -0,3,Mr. August Viktor Larsson,male,29,0,0,9.4833 -0,2,Mr. Samuel Greenberg,male,52,0,0,13 -0,3,Mr. Peter Andreas Lauritz Andersen Soholt,male,19,0,0,7.65 -1,1,Miss. Caroline Louise Endres,female,38,0,0,227.525 -1,2,Miss. Edwina Celia Troutt,female,27,0,0,10.5 -0,3,Mr. Malkolm Joackim Johnson,male,33,0,0,7.775 -1,2,Miss. Annie Jessie Harper,female,6,0,1,33 -0,3,Mr. Svend Lauritz Jensen,male,17,1,0,7.0542 -0,2,Mr. William Henry Gillespie,male,34,0,0,13 -0,2,Mr. Henry Price Hodges,male,50,0,0,13 -1,1,Mr. Norman Campbell Chambers,male,27,1,0,53.1 -0,3,Mr. Luka Oreskovic,male,20,0,0,8.6625 -1,2,Mrs. Peter Henry (Lillian Jefferys) Renouf,female,30,3,0,21 -1,3,Miss. Margareth Mannion,female,28,0,0,7.7375 -0,2,Mr. Kurt Arnold Gottfrid Bryhl,male,25,1,0,26 -0,3,Miss. Pieta Sofia Ilmakangas,female,25,1,0,7.925 -1,1,Miss. Elisabeth Walton Allen,female,29,0,0,211.3375 -0,3,Mr. Houssein G N Hassan,male,11,0,0,18.7875 -0,2,Mr. Robert J Knight,male,41,0,0,0 -0,2,Mr. William John Berriman,male,23,0,0,13 -0,2,Mr. Moses Aaron Troupiansky,male,23,0,0,13 -0,3,Mr. Leslie Williams,male,28.5,0,0,16.1 -0,3,Mrs. Edward (Margaret Ann Watson) Ford,female,48,1,3,34.375 -1,1,Mr. Gustave J Lesurer,male,35,0,0,512.3292 -0,3,Mr. Kanio Ivanoff,male,20,0,0,7.8958 -0,3,Mr. Minko Nankoff,male,32,0,0,7.8958 -1,1,Mr. Walter James Hawksford,male,45,0,0,30 -0,1,Mr. Tyrell William Cavendish,male,36,1,0,78.85 -1,1,Miss. Susan Parker Ryerson,female,21,2,2,262.375 -0,3,Mr. Neal McNamee,male,24,1,0,16.1 -1,3,Mr. Juho Stranden,male,31,0,0,7.925 -0,1,Capt. Edward Gifford Crosby,male,70,1,1,71 -0,3,Mr. Rossmore Edward Abbott,male,16,1,1,20.25 -1,2,Miss. Anna Sinkkonen,female,30,0,0,13 -0,1,Mr. Daniel Warner Marvin,male,19,1,0,53.1 -0,3,Mr. Michael Connaghton,male,31,0,0,7.75 -1,2,Miss. Joan Wells,female,4,1,1,23 -1,3,Master. Meier Moor,male,6,0,1,12.475 -0,3,Mr. Johannes Joseph Vande Velde,male,33,0,0,9.5 -0,3,Mr. Lalio Jonkoff,male,23,0,0,7.8958 -1,2,Mrs. Samuel (Jane Laver) Herman,female,48,1,2,65 -1,2,Master. Viljo Hamalainen,male,0.67,1,1,14.5 -0,3,Mr. August Sigfrid Carlsson,male,28,0,0,7.7958 -0,2,Mr. Percy Andrew Bailey,male,18,0,0,11.5 -0,3,Mr. Thomas Leonard Theobald,male,34,0,0,8.05 -1,1,the Countess. of (Lucy Noel Martha Dyer-Edwards) Rothes,female,33,0,0,86.5 -0,3,Mr. John Garfirth,male,23,0,0,14.5 -0,3,Mr. Iisakki Antino Aijo Nirva,male,41,0,0,7.125 -1,3,Mr. Hanna Assi Barah,male,20,0,0,7.2292 -1,1,Mrs. William Ernest (Lucile Polk) Carter,female,36,1,2,120 -0,3,Mr. Hans Linus Eklund,male,16,0,0,7.775 -1,1,Mrs. John C (Anna Andrews) Hogeboom,female,51,1,0,77.9583 -0,1,Dr. Arthur Jackson Brewe,male,46,0,0,39.6 -0,3,Miss. Mary Mangan,female,30.5,0,0,7.75 -0,3,Mr. Daniel J Moran,male,28,1,0,24.15 -0,3,Mr. Daniel Danielsen Gronnestad,male,32,0,0,8.3625 -0,3,Mr. Rene Aime Lievens,male,24,0,0,9.5 -0,3,Mr. Niels Peder Jensen,male,48,0,0,7.8542 -0,2,Mrs. (Mary) Mack,female,57,0,0,10.5 -0,3,Mr. Dibo Elias,male,29,0,0,7.225 -1,2,Mrs. Elizabeth (Eliza Needs) Hocking,female,54,1,3,23 -0,3,Mr. Pehr Fabian Oliver Malkolm Myhrman,male,18,0,0,7.75 -0,3,Mr. Roger Tobin,male,20,0,0,7.75 -1,3,Miss. Virginia Ethel Emanuel,female,5,0,0,12.475 -0,3,Mr. Thomas J Kilgannon,male,22,0,0,7.7375 -1,1,Mrs. Edward Scott (Elisabeth Walton McMillan) Robert,female,43,0,1,211.3375 -1,3,Miss. Banoura Ayoub,female,13,0,0,7.2292 -1,1,Mrs. Albert Adrian (Vera Gillespie) Dick,female,17,1,0,57 -0,1,Mr. Milton Clyde Long,male,29,0,0,30 -0,3,Mr. Andrew G Johnston,male,35,1,2,23.45 -0,3,Mr. William Ali,male,25,0,0,7.05 -0,3,Mr. Abraham (David Lishin) Harmer,male,25,0,0,7.25 -1,3,Miss. Anna Sofia Sjoblom,female,18,0,0,7.4958 -0,3,Master. George Hugh Rice,male,8,4,1,29.125 -1,3,Master. Bertram Vere Dean,male,1,1,2,20.575 -0,1,Mr. Benjamin Guggenheim,male,46,0,0,79.2 -0,3,Mr. Andrew Keane,male,20,0,0,7.75 -0,2,Mr. Alfred Gaskell,male,16,0,0,26 -0,3,Miss. Stella Anna Sage,female,21,8,2,69.55 -0,1,Mr. William Fisher Hoyt,male,43,0,0,30.6958 -0,3,Mr. Ristiu Dantcheff,male,25,0,0,7.8958 -0,2,Mr. Richard Otter,male,39,0,0,13 -1,1,Dr. Alice (Farnham) Leader,female,49,0,0,25.9292 -1,3,Mrs. Mara Osman,female,31,0,0,8.6833 -0,3,Mr. Yousseff Ibrahim Shawah,male,30,0,0,7.2292 -0,3,Mrs. Jean Baptiste (Rosalie Paula Govaert) Van Impe,female,30,1,1,24.15 -0,2,Mr. Martin Ponesell,male,34,0,0,13 -1,2,Mrs. Harvey (Charlotte Annie Tate) Collyer,female,31,1,1,26.25 -1,1,Master. William Thornton II Carter,male,11,1,2,120 -1,3,Master. Assad Alexander Thomas,male,0.42,0,1,8.5167 -1,3,Mr. Oskar Arvid Hedman,male,27,0,0,6.975 -0,3,Mr. Karl Johan Johansson,male,31,0,0,7.775 -0,1,Mr. Thomas Jr Andrews,male,39,0,0,0 -0,3,Miss. Ellen Natalia Pettersson,female,18,0,0,7.775 -0,2,Mr. August Meyer,male,39,0,0,13 -1,1,Mrs. Norman Campbell (Bertha Griggs) Chambers,female,33,1,0,53.1 -0,3,Mr. William Alexander,male,26,0,0,7.8875 -0,3,Mr. James Lester,male,39,0,0,24.15 -0,2,Mr. Richard James Slemen,male,35,0,0,10.5 -0,3,Miss. Ebba Iris Alfrida Andersson,female,6,4,2,31.275 -0,3,Mr. Ernest Portage Tomlin,male,30.5,0,0,8.05 -0,1,Mr. Richard Fry,male,39,0,0,0 -0,3,Miss. Wendla Maria Heininen,female,23,0,0,7.925 -0,2,Mr. Albert Mallet,male,31,1,1,37.0042 -0,3,Mr. John Fredrik Alexander Holm,male,43,0,0,6.45 -0,3,Master. Karl Thorsten Skoog,male,10,3,2,27.9 -1,1,Mrs. Charles Melville (Clara Jennings Gregg) Hays,female,52,1,1,93.5 -1,3,Mr. Nikola Lulic,male,27,0,0,8.6625 -0,1,Jonkheer. John George Reuchlin,male,38,0,0,0 -1,3,Mrs. (Beila) Moor,female,27,0,1,12.475 -0,3,Master. Urho Abraham Panula,male,2,4,1,39.6875 -0,3,Mr. John Flynn,male,36,0,0,6.95 -0,3,Mr. Len Lam,male,23,0,0,56.4958 -1,2,Master. Andre Mallet,male,1,0,2,37.0042 -1,3,Mr. Thomas Joseph McCormack,male,19,0,0,7.75 -1,1,Mrs. George Nelson (Martha Evelyn) Stone,female,62,0,0,80 -1,3,Mrs. Antoni (Selini Alexander) Yasbeck,female,15,1,0,14.4542 -1,2,Master. George Sibley Richards,male,0.83,1,1,18.75 -0,3,Mr. Amin Saad,male,30,0,0,7.2292 -0,3,Mr. Albert Augustsson,male,23,0,0,7.8542 -0,3,Mr. Owen George Allum,male,18,0,0,8.3 -1,1,Miss. Sara Rebecca Compton,female,39,1,1,83.1583 -0,3,Mr. Jakob Pasic,male,21,0,0,8.6625 -0,3,Mr. Maurice Sirota,male,20,0,0,8.05 -1,3,Mr. Chang Chip,male,32,0,0,56.4958 -1,1,Mr. Pierre Marechal,male,29,0,0,29.7 -0,3,Mr. Ilmari Rudolf Alhomaki,male,20,0,0,7.925 -0,2,Mr. Thomas Charles Mudd,male,16,0,0,10.5 -1,1,Miss. Augusta Serepeca,female,30,0,0,31 -0,3,Mr. Peter L Lemberopolous,male,34.5,0,0,6.4375 -0,3,Mr. Jeso Culumovic,male,17,0,0,8.6625 -0,3,Mr. Anthony Abbing,male,42,0,0,7.55 -0,3,Mr. Douglas Bullen Sage,male,18,8,2,69.55 -0,3,Mr. Marin Markoff,male,35,0,0,7.8958 -0,2,Rev. John Harper,male,28,0,1,33 -1,1,Mrs. Samuel L (Edwiga Grabowska) Goldenberg,female,40,1,0,89.1042 -0,3,Master. Sigvard Harald Elias Andersson,male,4,4,2,31.275 -0,3,Mr. Johan Svensson,male,74,0,0,7.775 -0,3,Miss. Nourelain Boulos,female,9,1,1,15.2458 -1,1,Miss. Mary Conover Lines,female,16,0,1,39.4 -0,2,Mrs. Ernest Courtenay (Lilian Hughes) Carter,female,44,1,0,26 -1,3,Mrs. Sam (Leah Rosen) Aks,female,18,0,1,9.35 -1,1,Mrs. George Dennick (Mary Hitchcock) Wick,female,45,1,1,164.8667 -1,1,Mr. Peter Denis Daly,male,51,0,0,26.55 -1,3,Mrs. Solomon (Latifa Qurban) Baclini,female,24,0,3,19.2583 -0,3,Mr. Raihed Razi,male,30,0,0,7.2292 -0,3,Mr. Claus Peter Hansen,male,41,2,0,14.1083 -0,2,Mr. Frederick Edward Giles,male,21,1,0,11.5 -1,1,Mrs. Frederick Joel (Margaret Welles Barron) Swift,female,48,0,0,25.9292 -0,3,Miss. Dorothy Edith Sage,female,14,8,2,69.55 -0,2,Mr. John William Gill,male,24,0,0,13 -1,2,Mrs. (Karolina) Bystrom,female,42,0,0,13 -1,2,Miss. Asuncion Duran y More,female,27,1,0,13.8583 -0,1,Mr. Washington Augustus II Roebling,male,31,0,0,50.4958 -0,3,Mr. Philemon van Melkebeke,male,23,0,0,9.5 -1,3,Master. Harold Theodor Johnson,male,4,1,1,11.1333 -0,3,Mr. Cerin Balkic,male,26,0,0,7.8958 -1,1,Mrs. Richard Leonard (Sallie Monypeny) Beckwith,female,47,1,1,52.5542 -0,1,Mr. Frans Olof Carlsson,male,33,0,0,5 -0,3,Mr. Victor Vander Cruyssen,male,47,0,0,9 -1,2,Mrs. Samuel (Hannah Wizosky) Abelson,female,28,1,0,24 -1,3,Miss. Adele Kiamie Najib,female,15,0,0,7.225 -0,3,Mr. Alfred Ossian Gustafsson,male,20,0,0,9.8458 -0,3,Mr. Nedelio Petroff,male,19,0,0,7.8958 -0,3,Mr. Kristo Laleff,male,23,0,0,7.8958 -1,1,Mrs. Thomas Jr (Lily Alexenia Wilson) Potter,female,56,0,1,83.1583 -1,2,Mrs. William (Imanita Parrish Hall) Shelley,female,25,0,1,26 -0,3,Mr. Johann Markun,male,33,0,0,7.8958 -0,3,Miss. Gerda Ulrika Dahlberg,female,22,0,0,10.5167 -0,2,Mr. Frederick James Banfield,male,28,0,0,10.5 -0,3,Mr. Henry Jr Sutehall,male,25,0,0,7.05 -0,3,Mrs. William (Margaret Norton) Rice,female,39,0,5,29.125 -0,2,Rev. Juozas Montvila,male,27,0,0,13 -1,1,Miss. Margaret Edith Graham,female,19,0,0,30 -0,3,Miss. Catherine Helen Johnston,female,7,1,2,23.45 -1,1,Mr. Karl Howell Behr,male,26,0,0,30 -0,3,Mr. Patrick Dooley,male,32,0,0,7.75 \ No newline at end of file diff --git a/gptables/examples/titanic.py b/gptables/examples/titanic.py deleted file mode 100644 index 98a11452..00000000 --- a/gptables/examples/titanic.py +++ /dev/null @@ -1,64 +0,0 @@ -""" -gptables example using the Titanic dataset. -@author: Ramiz Farishta -""" - -import gptables as gpt -import pandas as pd -import numpy as np -from pathlib import Path - -parent_dir = Path(__file__).parent -titanic = pd.read_csv(parent_dir / "titanic.csv") - -titanic["Child"] = np.where(titanic["Age"] < 18, 1, 0) - -sex_survived = titanic.groupby("Sex")["Survived"].sum() -sex_pclass = titanic.groupby("Sex")["Pclass"].apply(lambda x: x.mode().iloc[0]) -sex_child = titanic.groupby("Sex")["Child"].sum() -sex_fare = titanic.groupby("Sex")["Fare"].mean() - -titanic_analysis = pd.DataFrame( - { - "Survived": sex_survived, - "Pclass": sex_pclass, - "Child": sex_child, - "Fare": sex_fare, - } -).reset_index() - -table_name = "titanic_by_sex" -title = "Titanic$$singer$$ analysis by sex" -subtitles = ["Derived from a Kaggle competition dataset$$kaggle_link$$"] -units = {"Survived": "sum$$statistic$$", 2: "mode", 3: "sum", "Fare": "mean"} -scope = "Titanic$$singer$$" -source = "[Source: Kaggle](https://www.kaggle.com/competitions/titanic/overview)" -index = {2: 0} - -kwargs = { - "table_name": table_name, - "title": title, - "subtitles": subtitles, - "units": units, - "scope": scope, - "source": source, - "index_columns": index, - } - -# define our GPTable -titanic_table = gpt.GPTable(table=titanic_analysis, **kwargs) - -sheets = {"titanic analysis by sex": titanic_table} - -## Notesheet -notes_table = pd.read_csv(parent_dir / "titanic_notes.csv") - -if __name__ == "__main__": - output_path = parent_dir / "python_titanic_gptable.xlsx" - gpt.write_workbook( - filename=output_path, - sheets=sheets, - notes_table=notes_table, - contentsheet_options={"additional_elements": ["subtitles", "scope"]} - ) - print("Output written at: ", output_path) diff --git a/gptables/examples/titanic_notes.csv b/gptables/examples/titanic_notes.csv deleted file mode 100644 index 36ebdb29..00000000 --- a/gptables/examples/titanic_notes.csv +++ /dev/null @@ -1,5 +0,0 @@ -Note references,Note text,Useful links -kaggle_link,Competition dataset from Kaggle.,[Kaggle link](https://www.kaggle.com/competitions/titanic/overview) -singer,Celine Dion., -statistic,Total count., -just_another_ref,This note isn't used., From 0b3c087a2d740e2f87e184cbc1fd64312ad34458 Mon Sep 17 00:00:00 2001 From: Milne Date: Fri, 28 Jun 2024 14:54:52 +0100 Subject: [PATCH 21/28] Removes multiple sheets example from cover example --- gptables/examples/penguins_cover.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/gptables/examples/penguins_cover.py b/gptables/examples/penguins_cover.py index 4b982cc4..8447f13d 100644 --- a/gptables/examples/penguins_cover.py +++ b/gptables/examples/penguins_cover.py @@ -3,19 +3,16 @@ ----------------- This example demonstrates use of the ``gptables.Cover`` class to create a cover page. This example also -demonstrates the usage of the ``index_columns`` argument and how to create a workbook with multiple sheets. +demonstrates the usage of the ``index_columns``. A gptables cover page contains a range of custom text elements, along with a hyperlinked table of contents. Text elements are defined as a ``gptables.Cover`` instance, which is passed to the ``cover`` parameter of ``gptables.write_workbook()`` or ``gptables.produce_workbook()``. -In this example, we have also set ``auto_width`` to ``True``. -This automatically determines the width of the first column on the cover sheet, as well as all columns of the tables of the workbook. """ import gptables as gpt import pandas as pd import numpy as np from pathlib import Path -from copy import deepcopy ## Read data parent_dir = Path(__file__).parent @@ -46,13 +43,8 @@ ## Define our GPTable penguins_table = gpt.GPTable(table=penguins_data, table_name="penguins_statistics", **kwargs) -penguins_table_copy = deepcopy(penguins_table) -penguins_table_copy.set_title("A copy of the first sheet") -penguins_table_copy.set_table_name("penguins_statistics_copy") #All tables in a single workbook must have a unique name - penguins_sheets = { - "Penguins": penguins_table, - "Copy of Penguins": penguins_table_copy + "Penguins": penguins_table } penguins_cover = gpt.Cover( From 4b84afe8b9548835f46b0bbe9db855846efb8978 Mon Sep 17 00:00:00 2001 From: Milne Date: Fri, 28 Jun 2024 14:56:13 +0100 Subject: [PATCH 22/28] Adds separate multiple sheets example --- gptables/examples/penguins_multiple_sheets.py | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 gptables/examples/penguins_multiple_sheets.py diff --git a/gptables/examples/penguins_multiple_sheets.py b/gptables/examples/penguins_multiple_sheets.py new file mode 100644 index 00000000..97b4e15e --- /dev/null +++ b/gptables/examples/penguins_multiple_sheets.py @@ -0,0 +1,58 @@ +""" +Penguins - Cover Page +----------------- + +This example demonstrates how to create a workbook with multiple sheets. +""" + +import gptables as gpt +import pandas as pd +import numpy as np +from pathlib import Path +from copy import deepcopy + +## Read data +parent_dir = Path(__file__).parent + +penguins_data = pd.read_csv(parent_dir / "penguins.csv") + +#Any data processing could go here as long as you end with a Pandas dataframe that you want to write in a spreadsheet + +## Define table elements +penguins_table_name = "penguins_statistics" +penguins_title = "The Penguins Dataset" +penguins_subtitles = [ + "This is the first subtitle", + "Just another subtitle" + ] +penguins_scope = "Penguins" +penguins_source = "Palmer Station, Antarctica" + +kwargs = { + "table_name": penguins_table_name, + "title": penguins_title, + "subtitles": penguins_subtitles, + "scope": penguins_scope, + "source": penguins_source + } + +## Define our GPTable +penguins_table = gpt.GPTable(table=penguins_data, table_name="penguins_statistics", **kwargs) + +penguins_table_copy = deepcopy(penguins_table) +penguins_table_copy.set_title("A copy of the first sheet") +penguins_table_copy.set_table_name("penguins_statistics_copy") #All tables in a single workbook must have a unique name + +penguins_sheets = { + "Penguins": penguins_table, + "Copy of Penguins": penguins_table_copy +} + +## Use write_workbook to win! +if __name__ == "__main__": + output_path = parent_dir / "python_penguins_cover_gptable.xlsx" + gpt.write_workbook( + filename=output_path, + sheets=penguins_sheets + ) + print("Output written at: ", output_path) From d1c1da679eed45c3e3b6065ee396bc39189c9dba Mon Sep 17 00:00:00 2001 From: Milne Date: Fri, 28 Jun 2024 14:57:16 +0100 Subject: [PATCH 23/28] Removes additional things from minimal example --- gptables/examples/penguins_minimal.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/gptables/examples/penguins_minimal.py b/gptables/examples/penguins_minimal.py index 89a4aff8..07875b58 100644 --- a/gptables/examples/penguins_minimal.py +++ b/gptables/examples/penguins_minimal.py @@ -39,16 +39,6 @@ penguins_table = gpt.GPTable(table=penguins_data, table_name=penguins_table_name, title=penguins_title, subtitles=penguins_subtitles, scope=penguins_scope, source=penguins_source) -# or use kwargs to pass these to the appropriate parameters -# kwargs = { -# "table_name": penguins_table_name, -# "title": penguins_title, -# "subtitles": penguins_subtitles, -# "scope": penguins_scope, -# "source": penguins_source, -# } -#penguins_table = gpt.GPTable(table=penguins_data, **kwargs) would also be valid - #Every table must be associated to a sheet name for writing penguins_sheets = {"Penguins": penguins_table} From 1fea012c35cf813c6f34f88e86e73e68ba13c5c5 Mon Sep 17 00:00:00 2001 From: Milne Date: Fri, 28 Jun 2024 15:05:03 +0100 Subject: [PATCH 24/28] Replaces penguins theme with default theme --- .../examples/penguins_minimal_alternate.py | 53 +++++++++++++++++++ gptables/examples/penguins_theme.py | 5 +- gptables/themes/penguins_test_theme.yaml | 50 ----------------- 3 files changed, 55 insertions(+), 53 deletions(-) create mode 100644 gptables/examples/penguins_minimal_alternate.py delete mode 100644 gptables/themes/penguins_test_theme.yaml diff --git a/gptables/examples/penguins_minimal_alternate.py b/gptables/examples/penguins_minimal_alternate.py new file mode 100644 index 00000000..fcb7e896 --- /dev/null +++ b/gptables/examples/penguins_minimal_alternate.py @@ -0,0 +1,53 @@ +""" +Penguins - Minimal Example +---------------------- + +This example demonstrates another way to use the ``gptables.write_workbook`` function. +This code is equivalent to that in the above example. +""" + +import gptables as gpt +import pandas as pd +import numpy as np +from pathlib import Path + +## Read data +parent_dir = Path(__file__).parent + +penguins_data = pd.read_csv(parent_dir / "penguins.csv") + +#Any data processing could go here as long as you end with a Pandas dataframe that you want to write in a spreadsheet + +## Define table elements +penguins_table_name = "penguins_statistics" +penguins_title = "The Penguins Dataset" +penguins_subtitles = [ + "This is the first subtitle", + "Just another subtitle" + ] +penguins_scope = "Penguins" +penguins_source = "Palmer Station, Antarctica" + +#Use kwargs to pass these to the appropriate parameters +kwargs = { + "table_name": penguins_table_name, + "title": penguins_title, + "subtitles": penguins_subtitles, + "scope": penguins_scope, + "source": penguins_source, + } + +penguins_table = gpt.GPTable(table=penguins_data, **kwargs) + +#Every table must be associated to a sheet name for writing +penguins_sheets = {"Penguins": penguins_table} + +## Use write_workbook to win! +if __name__ == "__main__": + output_path = parent_dir / "python_penguins_gptable.xlsx" + gpt.write_workbook( + filename=output_path, + sheets=penguins_sheets, + contentsheet_options={"additional_elements": ["subtitles", "scope"]} + ) + print("Output written at: ", output_path) diff --git a/gptables/examples/penguins_theme.py b/gptables/examples/penguins_theme.py index 05e53f3a..4b21a5ba 100644 --- a/gptables/examples/penguins_theme.py +++ b/gptables/examples/penguins_theme.py @@ -9,8 +9,7 @@ Where you wish to provide no metadata in required parameters, use ``None``. The theme parameter must take either a directory or a yaml file in the ``gptables.write_workbook`` function. -The yaml file used in this example can be found in the themes folder as ''penguins_test_theme.yaml''. -The personalised theme removes any bold or italics from the table. +The yaml file used in this example can be found in the themes folder as ''gptheme.yaml''. """ import gptables as gpt @@ -50,7 +49,7 @@ # Simply pass the filepath of the yaml file containing your theme to the GPTables Theme class and then to write_workbook if __name__ == "__main__": output_path = parent_dir / "python_penguins_gptable.xlsx" - theme_path = str(Path(__file__).parent.parent / "themes/penguins_test_theme.yaml") + theme_path = str(Path(__file__).parent.parent / "themes/gptheme.yaml") gpt.write_workbook( filename=output_path, sheets=penguins_sheets, diff --git a/gptables/themes/penguins_test_theme.yaml b/gptables/themes/penguins_test_theme.yaml deleted file mode 100644 index f89fb3af..00000000 --- a/gptables/themes/penguins_test_theme.yaml +++ /dev/null @@ -1,50 +0,0 @@ -global: - font_size: 12 - font_name: Arial - font_color: 'automatic' - -cover_title: - font_size: 17 - -cover_subtitle: - font_size: 15 - -cover_text: - -title: - font_size: 16 - -subtitle: - font_size: 15 - -instructions: - -scope: - -column_heading: - bottom: 1 - text_wrap: 1 - -index_1: - text_wrap: 1 - -index_2: - text_wrap: 1 - -index_3: - text_wrap: 1 - -data: - text_wrap: 1 - -source: - font_size: 12 - -legend: - font_size: 12 - -description_order: - - instructions - - source - - legend - - scope \ No newline at end of file From f0f06a544533e635b502d48075c4e6e9ffc40a53 Mon Sep 17 00:00:00 2001 From: Milne Date: Fri, 28 Jun 2024 15:06:51 +0100 Subject: [PATCH 25/28] Removes R example --- docs/source/usage.rst | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/docs/source/usage.rst b/docs/source/usage.rst index ba35bc49..d95aebf1 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -43,11 +43,7 @@ examples_ directory of the package. :language: python :lines: 25- -.. .. automodule:: gptables.examples.cor_multiple_sheets -.. .. literalinclude:: ../../gptables/examples/cor_multiple_sheets.py -.. :language: python -.. :lines: 16- R Usage @@ -55,12 +51,5 @@ R Usage Use of ``gptables`` in R requires use of python via the `reticulate `_ package. -This example demonstrates basic usage of the pacakge in R. More advanced usage will -use a similar approach to python (above), but may require use of ``reticulate`` functions -to create/modify python objects. - -.. literalinclude:: ../../gptables/examples/iris.R - :language: R - -R users may also be interested in the `a11ytables `_ +However we recommend use of the `a11ytables `_ R package, developed by the Cabinet Office. \ No newline at end of file From 04a95287fe4af71fecbb8a258a54e20edd95ca02 Mon Sep 17 00:00:00 2001 From: Milne Date: Fri, 28 Jun 2024 15:09:34 +0100 Subject: [PATCH 26/28] Adds new examples --- docs/source/usage.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/source/usage.rst b/docs/source/usage.rst index d95aebf1..62aa0b40 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -19,6 +19,16 @@ examples_ directory of the package. :language: python :lines: 16- +.. automodule:: gptables.examples.penguins_minimal_alternate + +.. literalinclude:: ../../gptables/examples/penguins_minimal_alternate.py + :language: python + :lines: 16- + +.. literalinclude:: ../../gptables/examples/penguins_multiple_sheets.py + :language: python + :lines: 16- + .. automodule:: gptables.examples.penguins_theme .. literalinclude:: ../../gptables/examples/penguins_theme.py From ab680ea2f9a5bb6a02835155a40271dcd094bb44 Mon Sep 17 00:00:00 2001 From: Milne Date: Tue, 2 Jul 2024 17:06:09 +0100 Subject: [PATCH 27/28] Minor changes to multiple sheets example --- gptables/examples/penguins_multiple_sheets.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gptables/examples/penguins_multiple_sheets.py b/gptables/examples/penguins_multiple_sheets.py index 97b4e15e..e65a1768 100644 --- a/gptables/examples/penguins_multiple_sheets.py +++ b/gptables/examples/penguins_multiple_sheets.py @@ -1,8 +1,9 @@ """ -Penguins - Cover Page +Penguins - Multiple Pages ----------------- -This example demonstrates how to create a workbook with multiple sheets. +This example demonstrates how to create a workbook with multiple sheets. Note that it +will auto-generate a table of contents. """ import gptables as gpt From d3fb932fa3cb6f24d5278b93120d5f44d029a990 Mon Sep 17 00:00:00 2001 From: Milne Date: Tue, 2 Jul 2024 17:09:13 +0100 Subject: [PATCH 28/28] Re-adds specific example theme --- gptables/examples/penguins_theme.py | 4 +- gptables/themes/penguins_test_theme.yaml | 50 ++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 gptables/themes/penguins_test_theme.yaml diff --git a/gptables/examples/penguins_theme.py b/gptables/examples/penguins_theme.py index 4b21a5ba..a7ecde00 100644 --- a/gptables/examples/penguins_theme.py +++ b/gptables/examples/penguins_theme.py @@ -9,7 +9,7 @@ Where you wish to provide no metadata in required parameters, use ``None``. The theme parameter must take either a directory or a yaml file in the ``gptables.write_workbook`` function. -The yaml file used in this example can be found in the themes folder as ''gptheme.yaml''. +The yaml file used in this example can be found in the themes folder as ''penguins_test_theme.yaml''. """ import gptables as gpt @@ -49,7 +49,7 @@ # Simply pass the filepath of the yaml file containing your theme to the GPTables Theme class and then to write_workbook if __name__ == "__main__": output_path = parent_dir / "python_penguins_gptable.xlsx" - theme_path = str(Path(__file__).parent.parent / "themes/gptheme.yaml") + theme_path = str(Path(__file__).parent.parent / "themes/penguins_test_theme.yaml") gpt.write_workbook( filename=output_path, sheets=penguins_sheets, diff --git a/gptables/themes/penguins_test_theme.yaml b/gptables/themes/penguins_test_theme.yaml new file mode 100644 index 00000000..f89fb3af --- /dev/null +++ b/gptables/themes/penguins_test_theme.yaml @@ -0,0 +1,50 @@ +global: + font_size: 12 + font_name: Arial + font_color: 'automatic' + +cover_title: + font_size: 17 + +cover_subtitle: + font_size: 15 + +cover_text: + +title: + font_size: 16 + +subtitle: + font_size: 15 + +instructions: + +scope: + +column_heading: + bottom: 1 + text_wrap: 1 + +index_1: + text_wrap: 1 + +index_2: + text_wrap: 1 + +index_3: + text_wrap: 1 + +data: + text_wrap: 1 + +source: + font_size: 12 + +legend: + font_size: 12 + +description_order: + - instructions + - source + - legend + - scope \ No newline at end of file