Metadata-Version: 2.1
Name: a-pandas-ex-df-updater
Version: 0.1
Summary: Update a DataFrame/Series with the values of another
Home-page: https://github.com/hansalemaos/a_pandas_ex_df_updater
Author: Johannes Fischer
Author-email: <aulasparticularesdealemaosp@gmail.com>
License: MIT
Keywords: DataFrame,Series,Pandas
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Editors :: Text Processing
Classifier: Topic :: Text Processing :: General
Classifier: Topic :: Text Processing :: Indexing
Classifier: Topic :: Text Processing :: Filters
Classifier: Topic :: Utilities
Description-Content-Type: text/markdown
License-File: LICENSE.rst
Requires-Dist: pandas


```python



```



```python

#    Update a DataFrame/Series with the values of another.

    from a_pandas_ex_df_updater import pd_add_df_updater



    df1 = pd.DataFrame(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]),

                       columns=['a', 'b', 'c'])

    df2 = pd.DataFrame(np.array([[11, 2, 3], [4, 55, 6], [7, 8, 9], [17, 2, 93]]),

                       columns=['a', 'x', 'y'])





    df3=df1.ds_update(forupdate=df2,update_existing_values=True, add_new_columns=False,add_new_rows=False)



    df1

       a  b  c

    0  1  2  3

    1  4  5  6

    2  7  8  9

    df2

        a   x   y

    0  11   2   3

    1   4  55   6

    2   7   8   9

    3  17   2  93

    df3

        a  b  c

    0  11  2  3

    1   4  5  6

    2   7  8  9









    df3=df1.ds_update(forupdate=df2,update_existing_values=True, add_new_columns=True,add_new_rows=False)



    df1

       a  b  c

    0  1  2  3

    1  4  5  6

    2  7  8  9

    df2

        a   x   y

    0  11   2   3

    1   4  55   6

    2   7   8   9

    3  17   2  93

    df3

        a  b  c   x  y

    0  11  2  3   2  3

    1   4  5  6  55  6

    2   7  8  9   8  9









    df3=df1.ds_update(forupdate=df2,update_existing_values=True, add_new_columns=True,add_new_rows=True)



    df1

       a  b  c

    0  1  2  3

    1  4  5  6

    2  7  8  9

    df2

        a   x   y

    0  11   2   3

    1   4  55   6

    2   7   8   9

    3  17   2  93

    df3

        a    b    c   x   y

    0  11  2.0  3.0   2   3

    1   4  5.0  6.0  55   6

    2   7  8.0  9.0   8   9

    3  17  NaN  NaN   2  93









    df1.ds_update(forupdate=df2,update_existing_values=False, add_new_columns=True,add_new_rows=True)



    df1

       a  b  c

    0  1  2  3

    1  4  5  6

    2  7  8  9

    df2

        a   x   y

    0  11   2   3

    1   4  55   6

    2   7   8   9

    3  17   2  93

    df3

        a    b    c   x   y

    0   1  2.0  3.0   2   3

    1   4  5.0  6.0  55   6

    2   7  8.0  9.0   8   9

    3  17  NaN  NaN   2  93



        Parameters:

            df: Union[pd.Series, pd.DataFrame]

            forupdate: Union[pd.Series, pd.DataFrame]

            update_existing_values:bool

                (default=True)

            add_new_columns=True

                (default=True)

            add_new_rows=True

                (default=True)



        Returns:

            Union[pd.Series, pd.DataFrame]

```

