L irUddlmZddlZddlmZddlmZmZmZm Z m Z m Z m Z m Z ddlmZddlmZmZddlmZmZmZmZmZmZddlmZdd lmZmZmZm Z m!Z!dd l"m#Z#dd l$m%Z%dd l&m'Z'm(Z(m)Z)dd l*m+Z+m,Z,ddl-m.Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5m6Z6ddl7m8Z8m9Z9ddl:m;Z;er&ddlZ>ddl?mZ@ddlAmBZBddlCmDZDddlEmFZFddlGmHZHe dZIdeJd<hdZKdeJd<Gd d!e d"#ZLGd$d%e d"#ZMeGd&d'ZN d/d(ZO d0d)ZPGd*d+ZQ d1d,ZR d2 d3d-ZSd2d4d.ZTy)5) annotationsN) dataclass) TYPE_CHECKINGAnyFinalLiteral TypeAlias TypedDictcastoverload)dataframe_util)make_deprecated_name_warningshow_deprecation_warning)INDEX_IDENTIFIERColumnConfigMappingInputapply_data_specific_configsmarshall_column_configprocess_config_mappingupdate_column_config)current_form_id)HeightWithoutContent LayoutConfigWidthvalidate_heightvalidate_width)marshall_styler)check_widget_policies)Keycompute_and_register_element_idto_key)StreamlitAPIExceptionStreamlitValueError)Arrow) ForwardMsg)gather_metrics)enqueue_messageget_script_run_ctx)WidgetCallbackregister_widget)AttributeDictionary)HashableIterable)typing) DataFrame)Data)DeltaGenerator)AddRowsMetadata) single-row multi-row single-column multi-column single-cell multi-cellr SelectionMode>r3r7r2r6r5r4zFinal[set[SelectionMode]]_SELECTION_MODESc0eZdZUdZded<ded<ded<y) DataframeSelectionStatea( The schema for the dataframe selection state. The selection state is stored in a dictionary-like object that supports both key and attribute notation. Selection states cannot be programmatically changed or set through Session State. .. warning:: If a user sorts a dataframe, row selections will be reset. If your users need to sort and filter the dataframe to make selections, direct them to use the search function in the dataframe toolbar instead. Attributes ---------- rows : list[int] The selected rows, identified by their integer position. The integer positions match the original dataframe, even if the user sorts the dataframe in their browser. For a ``pandas.DataFrame``, you can retrieve data from its integer position using methods like ``.iloc[]`` or ``.iat[]``. columns : list[str] The selected columns, identified by their names. cells : list[tuple[int, str]] The selected cells, provided as a tuple of row integer position and column name. For example, the first cell in a column named "col 1" is represented as ``(0, "col 1")``. Cells within index columns are not returned. Example ------- The following example has multi-row and multi-column selections enabled. Try selecting some rows. To select multiple columns, hold ``CMD`` (macOS) or ``Ctrl`` (Windows) while selecting columns. Hold ``Shift`` to select a range of columns. >>> import pandas as pd >>> import streamlit as st >>> from numpy.random import default_rng as rng >>> >>> df = pd.DataFrame( ... rng(0).standard_normal((12, 5)), columns=["a", "b", "c", "d", "e"] ... ) >>> >>> event = st.dataframe( ... df, ... key="data", ... on_select="rerun", ... selection_mode=["multi-row", "multi-column", "multi-cell"], ... ) >>> >>> event.selection .. output:: https://doc-dataframe-events-selection-state.streamlit.app height: 600px z list[int]rowsz list[str]columnszlist[tuple[int, str]]cellsN__name__ __module__ __qualname____doc____annotations__^/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/elements/arrow.pyr;r;^s8t O   rFr;F)totalceZdZUdZded<y)DataframeStateaX The schema for the dataframe event state. The event state is stored in a dictionary-like object that supports both key and attribute notation. Event states cannot be programmatically changed or set through Session State. Only selection events are supported at this time. Attributes ---------- selection : dict The state of the ``on_select`` event. This attribute returns a dictionary-like object that supports both key and attribute notation. The attributes are described by the ``DataframeSelectionState`` dictionary schema. r; selectionNr?rErFrGrJrJs('&rFrJc eZdZdZddZddZy)DataframeSelectionSerdez[DataframeSelectionSerde is used to serialize and deserialize the dataframe selection state.c*dgggdi}||ntj|}d|vr|}d|dvrg|dd<d|dvrg|dd<d|dvr g|dd<n%|ddDcgc] }t|c}|dd<tdt |Scc}w)NrK)r<r=r>r<r=r>rJ)jsonloadstupler r*)selfui_valueempty_selection_stateselection_statecells rG deserializez#DataframeSelectionSerde.deserializes 1 &.%5 !4::h;O  o -3O 5 535OK ( 0 OK8 868OK ( 3 /+6 646OK ( 1,K8A5d 5OK ( 1 $&9/&JKK 5s Bc,tj|SN)rOdumps)rRstates rG serializez!DataframeSelectionSerde.serializeszz%  rFN)rS str | NonereturnrJ)r[rJr^str)r@rArBrCrWr\rErFrGrMrMse LD!rFrMct|tr|h}n t|}|jtst d|dt|j ddhr t d|j ddhr t d|j d d hr t d g}|D]}|dk(r*|jtjj3|dk(r*|jtjjb|dk(r*|jtjj|dk(r*|jtjj|d k(r*|jtjj|d k(s|jtjj t|S) z2Parse and check the user provided selection modes.zInvalid selection mode: z. Valid options are: r2r3zJOnly one of `single-row` or `multi-row` can be selected as selection mode.r4r5zPOnly one of `single-column` or `multi-column` can be selected as selection mode.r6r7zLOnly one of `single-cell` or `multi-cell` can be selected as selection mode.) isinstancer_setissubsetr9r! issupersetappend ArrowProtor8 SINGLE_ROW MULTI_ROW SINGLE_COLUMN MULTI_COLUMN SINGLE_CELL MULTI_CELL)selection_modeselection_mode_setparsed_selection_modesmodes rGparse_selection_moderqs.#&,-!0  & &'7 8#&~&67""2!3 5  $$lK%@A# X  $$o~%FG# ^  $$m\%BC# Z   " O <  " ) )**B*B*M*M N [ " ) )**B*B*L*L M _ $ " ) )**B*B*P*P Q ^ # " ) )**B*B*O*O P ] " " ) )**B*B*N*N O \ ! " ) )**B*B*M*M N O % &&rFct|tr6|rtjjStjj S|dk(rtjj Stdgd)z.Parse and check the user provided border mode. horizontalborder)TrueFalsez 'horizontal')raboolrf BorderModeALLNONE HORIZONTALr"rts rGparse_border_moder}s[&$,2z$$((R 8M8M8R8RR $$/// h(I JJrFc eZdZe dddddddddd ddZe ddddddddd ddZed dddddddddd dd Zed  dd d  dd ZeddddZeddZ y) ArrowMixinNignorer3)use_container_width hide_index column_order column_configkey on_selectrm row_heightcyrYrE rRdatawidthheightrrrrrrrmrs rG dataframezArrowMixin.dataframerF)rrrrrrmrcyrYrErs rGrzArrowMixin.dataframe.rrFrcddl} | dvrt| std| dt|}| dk7} | r4t| }t |j ||r t d| nddd| |2ttd d d d dd|rd}nt|tsd}t|dt|ddgt|}t}| r| |_|r||j ddtj"j$|_d}t|| j(rt+j,||_nt+j0|}t+j2|r;|j j5}t7t9|}t;|||t+j<|d}t+j>|}tA||t+jB||_|tE|tFd|in| r| dvr|rtE|tFdditI||tK||dk7r|nd}| r|jLjOtQ| tS|j |_*tW}tYd|d|j |j.||||j |jZ| | |  |_.t_}ta|j\t| r| nd|jb|jd|d}|j jgd|||jhS|j jgd||S) u4Display a dataframe as an interactive table. This command works with a wide variety of collection-like and dataframe-like object types. Parameters ---------- data : dataframe-like, collection-like, or None The data to display. Dataframe-like objects include dataframe and series objects from popular libraries like Dask, Modin, Numpy, pandas, Polars, PyArrow, Snowpark, Xarray, and more. You can use database cursors and clients that comply with the `Python Database API Specification v2.0 (PEP 249) `_. Additionally, you can use anything that supports the `Python dataframe interchange protocol `_. For example, you can use the following: - ``pandas.DataFrame``, ``pandas.Series``, ``pandas.Index``, ``pandas.Styler``, and ``pandas.Array`` - ``polars.DataFrame``, ``polars.LazyFrame``, and ``polars.Series`` - ``snowflake.snowpark.dataframe.DataFrame``, ``snowflake.snowpark.table.Table`` If a data type is not recognized, Streamlit will convert the object to a ``pandas.DataFrame`` or ``pyarrow.Table`` using a ``.to_pandas()`` or ``.to_arrow()`` method, respectively, if available. If ``data`` is a ``pandas.Styler``, it will be used to style its underlying ``pandas.DataFrame``. Streamlit supports custom cell values, colors, and font weights. It does not support some of the more exotic styling options, like bar charts, hovering, and captions. For these styling options, use column configuration instead. Text and number formatting from ``column_config`` always takes precedence over text and number formatting from ``pandas.Styler``. Collection-like objects include all Python-native ``Collection`` types, such as ``dict``, ``list``, and ``set``. If ``data`` is ``None``, Streamlit renders an empty table. width : "stretch", "content", or int The width of the dataframe element. This can be one of the following: - ``"stretch"`` (default): The width of the element matches the width of the parent container. - ``"content"``: The width of the element matches the width of its content, but doesn't exceed the width of the parent container. - An integer specifying the width in pixels: The element has a fixed width. If the specified width is greater than the width of the parent container, the width of the element matches the width of the parent container. height : "auto", "stretch", or int The height of the dataframe element. This can be one of the following: - ``"auto"`` (default): Streamlit sets the height to show at most ten rows. - ``"stretch"``: The height of the element expands to fill the available vertical space in its parent container. When multiple elements with stretch height are in the same container, they share the available vertical space evenly. The dataframe will maintain a minimum height to display up to three rows, but otherwise won't exceed the available height in its parent container. - An integer specifying the height in pixels: The element has a fixed height. Vertical scrolling within the dataframe element is enabled when the height does not accommodate all rows. use_container_width : bool Whether to override ``width`` with the width of the parent container. If this is ``True`` (default), Streamlit sets the width of the dataframe to match the width of the parent container. If this is ``False``, Streamlit sets the dataframe's width according to ``width``. .. deprecated:: ``use_container_width`` is deprecated and will be removed in a future release. For ``use_container_width=True``, use ``width="stretch"``. hide_index : bool or None Whether to hide the index column(s). If ``hide_index`` is ``None`` (default), the visibility of index columns is automatically determined based on the data and other configurations. column_order : Iterable[str] or None The ordered list of columns to display. If this is ``None`` (default), Streamlit displays all columns in the order inherited from the underlying data structure. If this is a list, the indicated columns will display in the order they appear within the list. Columns may be omitted or repeated within the list. For example, ``column_order=("col2", "col1")`` will display ``"col2"`` first, followed by ``"col1"``, and will hide all other non-index columns. ``column_order`` does not accept positional column indices and can't move the index column(s). column_config : dict or None Configuration to customize how columns are displayed. If this is ``None`` (default), columns are styled based on the underlying data type of each column. Column configuration can modify column names, visibility, type, width, format, and more. If this is a dictionary, the keys are column names (strings) and/or positional column indices (integers), and the values are one of the following: - ``None`` to hide the column. - A string to set the display label of the column. - One of the column types defined under ``st.column_config``. For example, to show a column as dollar amounts, use ``st.column_config.NumberColumn("Dollar values", format="$ %d")``. See more info on the available column types and config options `here `_. To configure the index column(s), use ``"_index"`` as the column name, or use a positional column index where ``0`` refers to the first index column. key : str An optional string to use for giving this element a stable identity. If ``key`` is ``None`` (default), this element's identity will be determined based on the values of the other parameters. Additionally, if selections are activated and ``key`` is provided, Streamlit will register the key in Session State to store the selection state. The selection state is read-only. on_select : "ignore" or "rerun" or callable How the dataframe should respond to user selection events. This controls whether or not the dataframe behaves like an input widget. ``on_select`` can be one of the following: - ``"ignore"`` (default): Streamlit will not react to any selection events in the dataframe. The dataframe will not behave like an input widget. - ``"rerun"``: Streamlit will rerun the app when the user selects rows, columns, or cells in the dataframe. In this case, ``st.dataframe`` will return the selection data as a dictionary. - A ``callable``: Streamlit will rerun the app and execute the ``callable`` as a callback function before the rest of the app. In this case, ``st.dataframe`` will return the selection data as a dictionary. selection_mode : "single-row", "multi-row", "single-column", "multi-column", "single-cell", "multi-cell", or Iterable of these The types of selections Streamlit should allow when selections are enabled with ``on_select``. This can be one of the following: - "multi-row" (default): Multiple rows can be selected at a time. - "single-row": Only one row can be selected at a time. - "multi-column": Multiple columns can be selected at a time. - "single-column": Only one column can be selected at a time. - "multi-cell": A rectangular range of cells can be selected. - "single-cell": Only one cell can be selected at a time. - An ``Iterable`` of the above options: The table will allow selection based on the modes specified. For example, to allow the user to select multiple rows and multiple cells, use ``["multi-row", "multi-cell"]``. When column selections are enabled, column sorting is disabled. row_height : int or None The height of each row in the dataframe in pixels. If ``row_height`` is ``None`` (default), Streamlit will use a default row height, which fits one line of text. Returns ------- element or dict If ``on_select`` is ``"ignore"`` (default), this command returns an internal placeholder for the dataframe element that can be used with the ``.add_rows()`` method. Otherwise, this command returns a dictionary-like object that supports both key and attribute notation. The attributes are described by the ``DataframeState`` dictionary schema. Examples -------- **Example 1: Display a dataframe** >>> import pandas as pd >>> import streamlit as st >>> from numpy.random import default_rng as rng >>> >>> df = pd.DataFrame( ... rng(0).standard_normal((50, 20)), columns=("col %d" % i for i in range(20)) ... ) >>> >>> st.dataframe(df) .. output:: https://doc-dataframe.streamlit.app/ height: 500px **Example 2: Use Pandas Styler** You can also pass a Pandas Styler object to change the style of the rendered DataFrame: >>> import pandas as pd >>> import streamlit as st >>> from numpy.random import default_rng as rng >>> >>> df = pd.DataFrame( ... rng(0).standard_normal((10, 20)), columns=("col %d" % i for i in range(20)) ... ) >>> >>> st.dataframe(df.style.highlight_max(axis=0)) .. output:: https://doc-dataframe1.streamlit.app/ height: 500px **Example 3: Use column configuration** You can customize a dataframe via ``column_config``, ``hide_index``, or ``column_order``. >>> import pandas as pd >>> import streamlit as st >>> from numpy.random import default_rng as rng >>> >>> df = pd.DataFrame( ... { ... "name": ["Roadmap", "Extras", "Issues"], ... "url": [ ... "https://roadmap.streamlit.app", ... "https://extras.streamlit.app", ... "https://issues.streamlit.app", ... ], ... "stars": rng(0).integers(0, 1000, size=3), ... "views_history": rng(0).integers(0, 5000, size=(3, 30)).tolist(), ... } ... ) >>> >>> st.dataframe( ... df, ... column_config={ ... "name": "App name", ... "stars": st.column_config.NumberColumn( ... "Github Stars", ... help="Number of stars on GitHub", ... format="%d ⭐", ... ), ... "url": st.column_config.LinkColumn("App URL"), ... "views_history": st.column_config.LineChartColumn( ... "Views (past 30 days)", y_min=0, y_max=5000 ... ), ... }, ... hide_index=True, ... ) .. output:: https://doc-dataframe-config.streamlit.app/ height: 350px **Example 4: Customize your index** You can use column configuration to format your index. >>> from datetime import datetime, date >>> import numpy as np >>> import pandas as pd >>> import streamlit as st >>> >>> @st.cache_data >>> def load_data(): >>> year = datetime.now().year >>> df = pd.DataFrame( ... { ... "Date": [date(year, month, 1) for month in range(1, 4)], ... "Total": np.random.randint(1000, 5000, size=3), ... } ... ) >>> df.set_index("Date", inplace=True) >>> return df >>> >>> df = load_data() >>> config = { ... "_index": st.column_config.DateColumn("Month", format="MMM YYYY"), ... "Total": st.column_config.NumberColumn("Total ($)"), ... } >>> >>> st.dataframe(df, column_config=config) .. output:: https://doc-dataframe-config-index.streamlit.app/ height: 225px rN)rrerunzYou have passed zH to `on_select`. But only 'ignore', 'rerun', or a callable is supported.rr(F) on_change default_valuewrites_allowedenable_check_callback_rulesrrz 2025-12-31znFor `use_container_width=True`, use `width='stretch'`. For `use_container_width=False`, use `width='content'`.)include_st_prefix)show_in_browserstretchcontentT) allow_contentauto)radditional_allowed) ensure_copyhidden)r3r2rrr) user_keykey_as_main_identitydgrrrrrrrmis_selection_activatedr string_value)on_change_handler deserializer serializerctx value_typearrow_data_frame layout_config)5pyarrowcallabler!r rrr rrraintrrrrfrr EditingMode READ_ONLY editing_modeTabler "convert_arrow_table_to_arrow_bytesrdetermine_data_formatis_pandas_styler_get_delta_path_strr_hashrconvert_anything_to_pandas_dfhas_range_indexr convert_pandas_df_to_arrow_bytesrrrrrmextendrqrform_idr'rr=idrMr)rWr\_enqueuevalue)rRrrrrrrrrrrmrpar is_callbackcolumn_config_mappingprotor data_format delta_path default_uuiddata_dfrrserde widget_states rGrzArrowMixin.dataframe?sQz  / /8K'"9+.77  Sk!*h!6 !"9-K !?J$/;PT"$,7    * $,) N&+ !& #!s+!uD1  &x !7} E  )E  $0E  q !'33== % dBHH %'JJ4PEJ )>>tDK..t4"WW88: "4 #34 t\:%BB%G-<>> import pandas as pd >>> import streamlit as st >>> >>> confusion_matrix = pd.DataFrame( ... { ... "Predicted Cat": [85, 3, 2, 1], ... "Predicted Dog": [2, 78, 4, 0], ... "Predicted Bird": [1, 5, 72, 3], ... "Predicted Fish": [0, 2, 1, 89], ... }, ... index=["Actual Cat", "Actual Dog", "Actual Bird", "Actual Fish"], ... ) >>> st.table(confusion_matrix) .. output:: https://doc-table-confusion.streamlit.app/ height: 250px **Example 2: Display a product leaderboard with Markdown and horizontal borders** >>> import streamlit as st >>> >>> product_data = { ... "Product": [ ... ":material/devices: Widget Pro", ... ":material/smart_toy: Smart Device", ... ":material/inventory: Premium Kit", ... ], ... "Category": [":blue[Electronics]", ":green[IoT]", ":violet[Bundle]"], ... "Stock": ["🟢 Full", "🟡 Low", "🔴 Empty"], ... "Units sold": [1247, 892, 654], ... "Revenue": [125000, 89000, 98000], ... } >>> st.table(product_data, border="horizontal") .. output:: https://doc-table-horizontal-border.streamlit.app/ height: 200px d)max_unevaluated_rowsrrr arrow_tabler) r}r is_unevaluated_data_objectrrrr_rrrfmarshall border_moder)rRrrtrrrrrs rGrzArrowMixin.tables`(/  4 4T :!??3DWW002 4 +, %  l+'ww uMRRrFadd_rowsc 0t|j|fi|S)aConcatenate a dataframe to the bottom of the current one. Parameters ---------- data : pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None Table to concat. Optional. **kwargs : pandas.DataFrame, numpy.ndarray, Iterable, dict, or None The named dataset to concat. Optional. You can only pass in 1 dataset (including the one in the data parameter). Example ------- >>> import time >>> import pandas as pd >>> import streamlit as st >>> from numpy.random import default_rng as rng >>> >>> df1 = pd.DataFrame( >>> rng(0).standard_normal(size=(50, 20)), columns=("col %d" % i for i in range(20)) >>> ) >>> >>> df2 = pd.DataFrame( >>> rng(1).standard_normal(size=(50, 20)), columns=("col %d" % i for i in range(20)) >>> ) >>> >>> my_table = st.table(df1) >>> time.sleep(1) >>> my_table.add_rows(df2) You can do the same thing with plots. For example, if you want to add more data to a line chart: >>> # Assuming df1 and df2 from the example above still exist... >>> my_chart = st.line_chart(df1) >>> time.sleep(1) >>> my_chart.add_rows(df2) And for plots whose datasets are named, you can pass the data with a keyword argument where the key is the name: >>> my_chart = st.vega_lite_chart( ... { ... "mark": "line", ... "encoding": {"x": "a", "y": "b"}, ... "datasets": { ... "some_fancy_name": df1, # <-- named dataset ... }, ... "data": {"name": "some_fancy_name"}, ... } ... ) >>> my_chart.add_rows(some_fancy_name=df2) # <-- name used as keyword )_arrow_add_rowsr)rRrkwargss rGrzArrowMixin.add_rows~sptww777rFctd|S)zGet our DeltaGenerator.r0)r )rRs rGrz ArrowMixin.dgs$d++rF)Nrr)rr/rrr&HeightWithoutContent | Literal['auto']r bool | NonerrrIterable[str] | NonerColumnConfigMappingInput | Noner Key | NonerzLiteral['ignore']rm'SelectionMode | Iterable[SelectionMode]r int | Noner^r0)rr/rrrrrrrrrrrrrrrz!Literal['rerun'] | WidgetCallbackrmrrrr^rJ)rr/rrrrrrrrrrrrrrrz+Literal['ignore', 'rerun'] | WidgetCallbackrmrrrr^zDeltaGenerator | DataframeStaterY)rr/rtbool | Literal['horizontal']r^r0)rr/rrr^DeltaGenerator | None)r^r0) r@rArBr rr%rrpropertyrrErFrGrrs  9?  ,0"&-19='/BM!%7  )  +7%@   9?  ,0"&-19=BM!%7  )  +75@  K  9? OX ,0"&-19=AIBM!%OXOXOX7 OX ) OX OX+OX7OXOX?OX@OXOX )OX!OXbGjSKOjSjS,HjS jSjSXJ78 78r,,rFrc|s0tj|r|dfStj|dfSddlm}|||S)Nr)prep_chart_data_for_add_rows)r rr+streamlit.elements.lib.built_in_chart_utilsr)radd_rows_metadatars rG_prep_data_for_add_rowsrsK   * *4 0: ;;DA4GGY '.? @@rFc |j |j|S|jjs td|t |dk(rd}n-t |dk(r|j \}}n tdd|jj vrD|jj dr*|jj djt||jj dj}|jj d}i}|j|j|d<|j|j|d <|j|j|d <|j|j|d <|jd k(r|j|d <|j|d<|j |j |d<||fi|yt#||jj d\}|jj d<t%}|jj&|j(j&ddt+t-|j/}t1|j2j4j6|||r6||j2j4_d|j2j4_t=||S)aConcatenate a dataframe to the bottom of the current one. Parameters ---------- data : pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict, or None Table to concat. Optional. **kwargs : pandas.DataFrame, numpy.ndarray, Iterable, dict, or None The named dataset to concat. Optional. You can only pass in 1 dataset (including the one in the data parameter). Example ------- >>> import time >>> import pandas as pd >>> import streamlit as st >>> from numpy.random import default_rng as rng >>> >>> df1 = pd.DataFrame( >>> rng(0).standard_normal(size=(50, 20)), columns=("col %d" % i for i in range(20)) >>> ) >>> >>> df2 = pd.DataFrame( >>> rng(1).standard_normal(size=(50, 20)), columns=("col %d" % i for i in range(20)) >>> ) >>> >>> my_table = st.table(df1) >>> time.sleep(1) >>> my_table.add_rows(df2) You can do the same thing with plots. For example, if you want to add more data to a line chart: >>> # Assuming df1 and df2 from the example above still exist... >>> my_chart = st.line_chart(df1) >>> time.sleep(1) >>> my_chart.add_rows(df2) And for plots whose datasets are named, you can pass the data with a keyword argument where the key is the name: >>> my_chart = st.vega_lite_chart( ... { ... "mark": "line", ... "encoding": {"x": "a", "y": "b"}, ... "datasets": { ... "some_fancy_name": df1, # <-- named dataset ... }, ... "data": {"name": "some_fancy_name"}, ... } ... ) >>> my_chart.add_rows(some_fancy_name=df2) # <-- name used as keyword Nz&Only existing elements can `add_rows`.rzLWrong number of arguments to add_rows().Command requires exactly one datasetrcolorrrstack bar_chartrssortrT)_root_container_cursor is_lockedr!lenpopitemprops last_indexgetattr chart_commandrrrrrsrrrr$rmetadatar_rrrdeltaarrow_add_rowsrnamehas_namer&) rrrr st_methodrnew_datamsgrs rGrrszv !RZZ%7 ::  #$LMM CK1, V ^^% d$ 3   rzz/// JJ  0 1 JJ  0 1 < < DB 0 01D E S ST ::##$78 >> %&nnF7O >> %&nnF7O ?? &'F8  >> %&nnF7O  ! ![ 0#+#6#6F< %]]F6N  ' ' 3,4,H,HF( )$!&!6M  ,-73Hbjj23 ,C!#!6!6CLLAtB22456L SYY % % * *HlC (,   %,0   )C IrFctj|r(t|ts t dt |||tj ||_y)aXMarshall pandas.DataFrame into an Arrow proto. Parameters ---------- proto : proto.Arrow Output. The protobuf for Streamlit Arrow proto. data : pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, Iterable, dict, or None Something that is or can be converted to a dataframe. default_uuid : str | None If pandas.Styler UUID is not provided, this value will be used. This attribute is optional and only used for pandas.Styler, other elements (e.g. charts) can ignore it. z.Default UUID must be a string for Styler data.N)r rrar_r!rconvert_anything_to_arrow_bytesr)rrrs rGrrWsN$&&t,,,'@  t\2??EEJrF)rmrr^z'set[ArrowProto.SelectionMode.ValueType])rtrr^zArrowProto.BorderMode.ValueType)rr/rzAddRowsMetadata | Noner^z#tuple[Data, AddRowsMetadata | None]rY)rr0rr/rzIDataFrame | npt.NDArray[Any] | Iterable[Any] | dict[Hashable, Any] | Noner^r)rrfrr/rr]r^None)U __future__rrO dataclassesrr-rrrrr r r r streamlitr streamlit.deprecation_utilrr*streamlit.elements.lib.column_config_utilsrrrrrr!streamlit.elements.lib.form_utilsr#streamlit.elements.lib.layout_utilsrrrrr*streamlit.elements.lib.pandas_styler_utilsrstreamlit.elements.lib.policiesrstreamlit.elements.lib.utilsrrr streamlit.errorsr!r"streamlit.proto.Arrow_pb2r#rfstreamlit.proto.ForwardMsg_pb2r$streamlit.runtime.metrics_utilr%7streamlit.runtime.scriptrunner_utils.script_run_contextr&r'streamlit.runtime.stater(r)streamlit.utilr*collections.abcr+r,numpynptpandasr.streamlit.dataframe_utilr/streamlit.delta_generatorr0rr1r8rDr9r;rJrMrqr}rrrrrErFrGrsx# !   %>GAUUG959D.2# -8K# y/+=!iu=!@'Ye'0 &!&! &!R.';.',.'bK (K$K_ ,_ ,DA A-A)A0@@ @X@ @FFrF