I'm trying to display the data containing in a panda's dataframe using the df.head()
method. But nothing gets printed in the console. Also, I get no errors... Below is the source code:
import pandas as pd
import logging
# Setup logger.
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Load the data.
logger.info("Loading data...")
retail_data = pd.read_excel('data/retail_data.xlsx')
logger.info("Data loaded.")
retail_data.head()
The retail_data.info()
method works as expected so there's nothing wrong with the creation of the dataframe. I'm on Python 3.5 but tested it on Python 2.7 as well. Also, there's a similar question on stackoverflow (python pandas dataframe head() displays nothing) but it is not very helpful for me.