In a file (for simplicity, I will refer to it as stocks.py) I have this function included:
def symbol_input(userinput):
if userinput.isupper():
symbol = (df[df['Symbol'] == userinput])
return symbol
which takes a stock ticker input (ex. AAPL) and outputs this:
Company Symbol Weight Price Chg % Chg
0 Apple Inc. AAPL 6.888732 177.65 -1.73 (-0.96%)
I'm pretty new to Python, but I basically want to call this function from an input in another file, portfolio.py which has stocks.py included. In short, how do I take the input from portfolio.py to make it go to the function above?