Skip to content

Commit 56a1b34

Browse files
committed
update docstring for ff create_table
1 parent f6e3b34 commit 56a1b34

File tree

1 file changed

+23
-21
lines changed
  • packages/python/plotly/plotly/figure_factory

1 file changed

+23
-21
lines changed

packages/python/plotly/plotly/figure_factory/_table.py

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,35 +39,38 @@ def create_table(
3939
See also the plotly.graph_objects trace
4040
:class:`plotly.graph_objects.Table`
4141
42-
:param (pandas.Dataframe | list[list]) text: data for table.
43-
:param (str|list[list]) colorscale: Colorscale for table where the
44-
color at value 0 is the header color, .5 is the first table color
45-
and 1 is the second table color. (Set .5 and 1 to avoid the striped
46-
table effect). Default=[[0, '#66b2ff'], [.5, '#d9d9d9'],
42+
Parameters
43+
----------
44+
text : pandas.DataFrame or list of list
45+
Data for table.
46+
colorscale : str or list of list
47+
Colorscale for table where the color at value 0 is the header color, .5 is the first table color
48+
and 1 is the second table color. (Set .5 and 1 to avoid the striped table effect). Default=[[0, '#66b2ff'], [.5, '#d9d9d9'],
4749
[1, '#ffffff']]
48-
:param (list) font_colors: Color for fonts in table. Can be a single
49-
color, three colors, or a color for each row in the table.
50+
font_colors : list
51+
Color for fonts in table. Can be a single color, three colors, or a color for each row in the table.
5052
Default=['#000000'] (black text for the entire table)
51-
:param (int) height_constant: Constant multiplied by # of rows to
52-
create table height. Default=30.
53-
:param (bool) index: Create (header-colored) index column index from
54-
Pandas dataframe or list[0] for each list in text. Default=False.
55-
:param (string) index_title: Title for index column. Default=''.
56-
:param kwargs: kwargs passed through plotly.graph_objs.Heatmap.
57-
These kwargs describe other attributes about the annotated Heatmap
58-
trace such as the colorscale. For more information on valid kwargs
59-
call help(plotly.graph_objs.Heatmap)
60-
53+
height_constant : int
54+
Constant multiplied by the number of rows to create table height. Default=30.
55+
index : bool
56+
Create (header-colored) index column index from Pandas dataframe or list[0] for each list in text. Default=False.
57+
index_title : str
58+
Title for index column. Default=''.
59+
**kwargs
60+
Additional keyword arguments passed through to `plotly.graph_objs.Heatmap`.
61+
These kwargs describe other attributes about the annotated Heatmap trace such as the colorscale.
62+
For more information on valid kwargs call `help(plotly.graph_objs.Heatmap)`.
63+
64+
Examples
65+
--------
6166
Example 1: Simple Plotly Table
6267
6368
>>> from plotly.figure_factory import create_table
64-
6569
>>> text = [['Country', 'Year', 'Population'],
6670
... ['US', 2000, 282200000],
6771
... ['Canada', 2000, 27790000],
6872
... ['US', 2010, 309000000],
6973
... ['Canada', 2010, 34000000]]
70-
7174
>>> table = create_table(text)
7275
>>> table.show()
7376
@@ -84,7 +87,7 @@ def create_table(
8487
... [.5, '#80beff'],
8588
... [1, '#cce5ff']],
8689
... font_colors=['#ffffff', '#000000',
87-
... '#000000'])
90+
... '#000000'])
8891
>>> table.show()
8992
9093
Example 3: Simple Plotly Table with Pandas
@@ -95,7 +98,6 @@ def create_table(
9598
>>> df_p = df[0:25]
9699
>>> table_simple = create_table(df_p)
97100
>>> table_simple.show()
98-
99101
"""
100102

101103
# Avoiding mutables in the call signature

0 commit comments

Comments
 (0)