Take a simple function that takes str and returns a dataframe:
import pandas as pd def csv_to_df(path): return pd.read_csv(path, skiprows=1, sep='\t', comment='#')
What is the recommended pythonic way of adding tooltip types to this function?
If I set python for the DataFrame type, it returns pandas.core.frame.DataFrame . However, the following will not work, as this will tell me that pandas is not defined.
def csv_to_df(path: str) -> pandas.core.frame.DataFrame: return pd.read_csv(path, skiprows=1, sep='\t', comment='#')
source share