My function returns a pandas series, where all elements have a specific type (say str). The following MWE should give an impression:
str
import pandas as
You can specify using dtype parameter
pd.Series(data, dtype=str) for more information click here
pd.Series(data, dtype=str)