# Custom Expectations for Pandas

**URL:** <https://discourse.greatexpectations.io/t/custom-expectations-for-pandas/1075>\
**Category:** Archive\
**Tags:** help-wanted\
**Created:** [July 6, 2022, 1:01pm UTC](https://discourse.greatexpectations.io/t/custom-expectations-for-pandas/1075 "2022-07-06T13:01:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Adarsh](https://discourse.greatexpectations.io/u/Adarsh)\
**Post date:** [July 6, 2022, 1:01pm UTC](https://discourse.greatexpectations.io/t/custom-expectations-for-pandas/1075/1 "2022-07-06T13:01:26Z")

</div>

Hello Everyone,

I am following the guide on how to create a column pair map expectations, everything seems to work fine except for the Testing part.

None of my test cases are getting passed, I checked the metric code multiple times by developing a separate file to check the logic replicating the inputs and the output is as expected.

```auto
def check_conditions(x, condition) -> bool:
    return (x[0], x[1]) in condition.items()

def _pandas(column_A, column_B, condition):
    df = concat([column_A, column_B], axis=1)
    return df.apply(lambda x: check_conditions(x, condition), axis=1)

inputs:

column A = [1, 1, 2, 1, 2]
column B = ["UK", "UK", "US", "UK", "US"]
condition = {1: "UK", 2: "US"}

output:

0 True
1 True
2 True
3 True
4 True
dtype: bool

```

But it seems to not work only with the expectation code. Can someone please help me with this.
