Add docstrings to table to_format methods
parent
fcef880e6c
commit
1b013178a8
|
|
@ -321,6 +321,9 @@ class Table(object):
|
||||||
|
|
||||||
def to_csv(self, path, **kwargs):
|
def to_csv(self, path, **kwargs):
|
||||||
"""Write Table to a comma-separated values (csv) file.
|
"""Write Table to a comma-separated values (csv) file.
|
||||||
|
|
||||||
|
Check `pandas.DataFrame.to_csv <https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_csv.html>`_
|
||||||
|
kwargs for more details around what kwargs to use.
|
||||||
"""
|
"""
|
||||||
kw = {
|
kw = {
|
||||||
'encoding': 'utf-8',
|
'encoding': 'utf-8',
|
||||||
|
|
@ -332,6 +335,9 @@ class Table(object):
|
||||||
|
|
||||||
def to_json(self, path, **kwargs):
|
def to_json(self, path, **kwargs):
|
||||||
"""Write Table to a JSON file.
|
"""Write Table to a JSON file.
|
||||||
|
|
||||||
|
Check `pandas.DataFrame.to_json <https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_json.html>`_
|
||||||
|
kwargs for more details around what kwargs to use.
|
||||||
"""
|
"""
|
||||||
kw = {
|
kw = {
|
||||||
'orient': 'records'
|
'orient': 'records'
|
||||||
|
|
@ -343,6 +349,9 @@ class Table(object):
|
||||||
|
|
||||||
def to_excel(self, path, **kwargs):
|
def to_excel(self, path, **kwargs):
|
||||||
"""Write Table to an Excel file.
|
"""Write Table to an Excel file.
|
||||||
|
|
||||||
|
Check `pandas.DataFrame.to_excel <https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_excel.html>`_
|
||||||
|
kwargs for more details around what kwargs to use.
|
||||||
"""
|
"""
|
||||||
kw = {
|
kw = {
|
||||||
'sheet_name': 'page-{}-table-{}'.format(self.page, self.order),
|
'sheet_name': 'page-{}-table-{}'.format(self.page, self.order),
|
||||||
|
|
@ -355,6 +364,9 @@ class Table(object):
|
||||||
|
|
||||||
def to_html(self, path, **kwargs):
|
def to_html(self, path, **kwargs):
|
||||||
"""Write Table to an HTML file.
|
"""Write Table to an HTML file.
|
||||||
|
|
||||||
|
Check `pandas.DataFrame.to_html <https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_html.html>`_
|
||||||
|
kwargs for more details around what kwargs to use.
|
||||||
"""
|
"""
|
||||||
html_string = self.df.to_html(**kwargs)
|
html_string = self.df.to_html(**kwargs)
|
||||||
with open(path, 'w') as f:
|
with open(path, 'w') as f:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue