I saw this line of code from a book, what does that mean? After that, I print portfolio, it is just a underscore, but it is not empty DataFrame.
portfolio = portfolio = pd.DataFrame()
You’re seeing the result of how an empty DataFrame is displayed,. The DataFrame is in fact empty; you can see this better using a
import pandas as pd df = pd.DataFrame() display(df) #_ print(df) #Empty DataFrame #Columns:  #Index:  df.empty #True