I have two functions that take in a pd.Series
argument
def function_1(ages:pd.Series)->float:
...
and
def function_2(names:pd.Series)->int:
...
However, for function_1
the input is a pd.Series
of integers, and for function_2
it's a pd.Series
of strings.
I'd like to be able to write:
def function_1(ages:pd.Series[int])->float:
...
def function_2(names:pd.Series[str])->int:
...
However this gives the error:
TypeError: 'type' object is not subscriptable
Note: for now I'm doing
def function_1(ages:'pd.Series[int]')->float:
...
def function_2(names:'pd.Series[str]')->int:
...