Skip to main content

Puts objects into cells / columns of a Pandas Dataframe

pip install a-pandas-ex-obj-into-cell
Not best (Pandas) practice, but sometimes very useful :)
from a_pandas_ex_obj_into_cell import pd_add_obj_into_cells

import pandas as pd



pd_add_obj_into_cells()

df = pd.read_csv(

    "https://raw.githubusercontent.com/pandas-dev/pandas/main/doc/data/titanic.csv"

)



d1 = df.d_one_object_to_several_cells(

    column="test1",

    value=({1: ("xx", 331, 11)}),

    indexlist=[1, 2, 3, 7],

    ffill=True,

    bfill=True,

)



print(d1)

d2 = df.d_list_items_to_cells(

    column="test2",

    values=[

        [

            1,

            32,

            4,

        ],

        {33: "dfd", 0: [3, 2]},

        4,

        (5, 34),

    ],

    indexlist=[1, 4, 6, 9],

    ffill=False,

    bfill=False,

)

print(d2)





'''     

PassengerId  Survived  Pclass  ... Cabin Embarked                 test1

0              1         0       3  ...   NaN        S  {1: ('xx', 331, 11)}

1              2         1       1  ...   C85        C  {1: ('xx', 331, 11)}

2              3         1       3  ...   NaN        S  {1: ('xx', 331, 11)}

3              4         1       1  ...  C123        S  {1: ('xx', 331, 11)}

4              5         0       3  ...   NaN        S  {1: ('xx', 331, 11)}

..           ...       ...     ...  ...   ...      ...                   ...

886          887         0       2  ...   NaN        S  {1: ('xx', 331, 11)}

887          888         1       1  ...   B42        S  {1: ('xx', 331, 11)}

888          889         0       3  ...   NaN        S  {1: ('xx', 331, 11)}

889          890         1       1  ...  C148        C  {1: ('xx', 331, 11)}

890          891         0       3  ...   NaN        Q  {1: ('xx', 331, 11)}

[891 rows x 13 columns]

     PassengerId  Survived  Pclass  ... Cabin Embarked                   test2

0              1         0       3  ...   NaN        S                    <NA>

1              2         1       1  ...   C85        C              [1, 32, 4]

2              3         1       3  ...   NaN        S                    <NA>

3              4         1       1  ...  C123        S                    <NA>

4              5         0       3  ...   NaN        S  {33: 'dfd', 0: [3, 2]}

..           ...       ...     ...  ...   ...      ...                     ...

886          887         0       2  ...   NaN        S                     NaN

887          888         1       1  ...   B42        S                     NaN

888          889         0       3  ...   NaN        S                     NaN

889          890         1       1  ...  C148        C                     NaN

890          891         0       3  ...   NaN        Q                     NaN

[891 rows x 13 columns]'''

Metadata

Release files for a-pandas-ex-obj-into-cell 0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for a-pandas-ex-obj-into-cell 0.12
File Size Uploaded Provenance Actions
a_pandas_ex_obj_into_cell-0.12.tar.gz 4.4 kB Without provenance Details for a_pandas_ex_obj_into_cell-0.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for a-pandas-ex-obj-into-cell 0.12
File Interpreter ABI Platform Actions
a_pandas_ex_obj_into_cell-0.12-py3-none-any.whl Python 3 none any Details for a_pandas_ex_obj_into_cell-0.12-py3-none-any.whl

Total release size: 10.5 kB

Release files / a_pandas_ex_obj_into_cell-0.12.tar.gz

Download URL a_pandas_ex_obj_into_cell-0.12.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ca75f6cf3bbc7a2017364eb791c50ffc121a1186def53bc9cebb98295ee92700
BLAKE2b-256 checksum
How to use checksums
63665ec05b3f7649eeee8dabb957fa899856b2140892e504a5f4206b10237e18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / a_pandas_ex_obj_into_cell-0.12-py3-none-any.whl

Download URL a_pandas_ex_obj_into_cell-0.12-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51026cf15e9f60fa263a464612fe33c20674cc4a87d616912c82bf1a5282f4ef
BLAKE2b-256 checksum
How to use checksums
e4874341f3cfc2a6c406501431715ff7885eb56d42306e25f12d067eb446f5a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for a-pandas-ex-obj-into-cell 0.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.12 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page