Q:

simple apply to concat pandas-columns

How can I make this program work? The result should be concatenated integers:
import pandas as pd
d = pd.DataFrame({'A': range(5), 'B': range(5, 10)})
f = lambda x, y: str(x) + str(y)
d[['A', 'B']].apply(f, axis = 1)

Thx & kind regards 

A:

In apply with DataFrame and axis=1 each loop generate Series:
f = lambda x: str(x.A) + str(x.B)
a = d[['A', 'B']].apply(f, axis = 1)

Very similar is possible convert both columns to strings first:
f = lambda x: x.A + x.B
a = d[['A', 'B']].astype(str).apply(f, axis = 1)

You can check processing by custom function:
def f(x):
    print (x)
    print (x.A)
    print (x.B)
    return str(x.A) + str(x.B)

a = d[['A', 'B']].apply(f, axis = 1)

A    0
B    5
Name: 0, dtype: int64
0
5
A    1
B    6
Name: 1, dtype: int64
1
6
A    2
B    7
Name: 2, dtype: int64
2
7
A    3
B    8
Name: 3, dtype: int64
3
8
A    4
B    9
Name: 4, dtype: int64
4
9

But better/faster is join with +, but first cast numeric columns to strings:
a = d['A'].astype(str) + d['B'].astype(str)

print (a)
0    05
1    16
2    27
3    38
4    49
dtype: object

