ds_resource_plugin_py_lib.common.serde.serialize.pandas ======================================================= .. py:module:: ds_resource_plugin_py_lib.common.serde.serialize.pandas .. autoapi-nested-parse:: **File:** ``pandas.py`` **Region:** ``ds_resource_plugin_py_lib/common/serde/serialize`` Description ----------- Serialize a pandas DataFrame into a value. .. rubric:: Example .. code-block:: python import pandas as pd from ds_resource_plugin_py_lib.common.resource.dataset.storage_format import DatasetStorageFormatType from ds_resource_plugin_py_lib.common.serde.serialize.pandas import PandasSerializer df = pd.DataFrame({"a": [1, 2], "b": ["x", "y"]}) serializer = PandasSerializer(format=DatasetStorageFormatType.CSV) csv_text = serializer(df, index=False) Attributes ---------- .. autoapisummary:: ds_resource_plugin_py_lib.common.serde.serialize.pandas.logger Classes ------- .. autoapisummary:: ds_resource_plugin_py_lib.common.serde.serialize.pandas.PandasSerializer Module Contents --------------- .. py:data:: logger .. py:class:: PandasSerializer Bases: :py:obj:`ds_resource_plugin_py_lib.common.serde.serialize.base.DataSerializer` Extensible class to serialize dataset content. Convert obj to bytes. Not supposed to be used directly, but to be subclassed. .. py:attribute:: format :type: ds_resource_plugin_py_lib.common.resource.dataset.storage_format.DatasetStorageFormatType .. py:attribute:: kwargs :type: dict[str, Any] .. py:method:: __call__(obj: Any, **_kwargs: Any) -> Any Serialize a pandas DataFrame into a value. :param obj: The pandas DataFrame to serialize. :param \*\*kwargs: Additional keyword arguments. :returns: A value.