On 8 November 2017 at 11:15, Karsten Hilbert <karsten.hilb...@gmx.net> wrote:
> On Wed, Nov 08, 2017 at 09:26:04AM +0000, David Shi via Python-list wrote:
>
>>  I am trying to gain a clear understanding on pd.merge(df,df2, on=['Code', 
>> 'Region']).
>> Can anyone assist?
>
>         ncq@hermes:~$ python
>         Python 2.7.14 (default, Sep 17 2017, 18:50:44)
>         [GCC 7.2.0] on linux2
>         Type "help", "copyright", "credits" or "license" for more information.
>         >>> pd.merge(df,df2, on=['Code', 'Region'])
>         Traceback (most recent call last):
>           File "<stdin>", line 1, in <module>
>         NameError: name 'pd' is not defined
>         >>>
>
> You will need to provide more context to get help.

... but given that I happen to know (mostly by chance) that pd is a
commonly used short form when importing Pandas ("import pandas as pd")
you should probably start with the documentation on merge:
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.merge.html

If that isn't sufficient for you, please provide a better explanation
of what you don't understand, what you have tried and how it didn't
match your expectations, and maybe someone on the list who is familiar
with Pandas will be able to assist you.

Paul
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to