Question: I am starting to learn and understand panda module in Python. However, my issue is with the rename string. The rename works fine when i use print, this shows the column has been renamed:

```
print(data.rename(columns={"Rep": "Name"}))

```

However, when i use print(data), to show all of the data from the document, the column does not show as being renamed. This also does not show when the file has been exported using the data.to\_csv("example.csv") string.

Would really appreciate if somebody could shed some light on this please.

Full Source code below:

```
import pandas as pd

data = pd.read_excel(r"D:\Downloads\Book1.xlsx")

del data["Region"]
del data["Item"]

print(data.rename(columns={"Rep": "Name"})

print(data)

data.to_csv("example.csv")

```

Answer: 
You can do this:

```
Sub Main() 
    Dim localM As Func(Of Integer, Integer) = AddressOf C.m
    Console.writeline(localM(5))
End Sub

```

You can see it work here:

> 
> <https://dotnetfiddle.net/Uxl0Y7>
> 
> 
> 

I didn't change anything in the sample class, except to complete the function so it returns a value (required for the function to compile) and to fix your lousy capitalization.

---

> 
> I'm actually passing it to function as an argument
> 
> 
> 

In that case:

```
Sub Main() 
    Dim localM As Func(Of Integer, Integer) = AddressOf C.m
    Foo(localM)

    ' Or

    Foo(AddressOf C.m)
End Sub

Sub Foo(theMethod As Func(Of Integer, Integer))
    Console.WriteLine(theMethod(5))
End Sub

```

---

In either case, the trick is to do two things:

1. Define either an `Action` (for a `Sub`) or `Func` (for a `Function`) that matches the signature of the target method. In this case, it's `Func(Of Integer, Integer)`. Any method up to 8 arguments can be mapped this way, but you do have to know the signature in advance.
2. Use `AddressOf` to capture the reference to the method.
Is this what you are looking for?

```
Class C
    Public Shared Add1 As Func(Of Integer, Integer) = Function(value As Integer)
                                                          Return value + 1
                                                      End Function

End Class

```

to use

```
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim foo As Integer = C.Add1(3)
    Debug.WriteLine(foo)
End Sub

```

**edit**

```
Class C
    Public Shared Add1 As Func(Of Integer, Integer) = Function(value As Integer)
                                                          Return value + 1
                                                      End Function

    Public Shared DebugStr As Action(Of String, String) = Sub(first As String, second As String)
                                                              Debug.WriteLine("One-{0}  Two-{1}",
                                                                                first, second)
                                                          End Sub

End Class

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim foo As Integer = C.Add1(7)
    Debug.WriteLine(foo)

    C.DebugStr("Quick", "Fox")
End Sub

```