0

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.

Community
  • 1
  • 1
Dimitris Poulopoulos
  • 1,139
  • 2
  • 15
  • 36
  • Try to increase the size of the terminal to see if it's displaying properly - [Look here for details](http://stackoverflow.com/questions/13085709/df-head-sometimes-doesnt-work-in-pandas-python) – Nickil Maveli Dec 10 '16 at 13:05
  • That's not an issue. I used `print(retail_data.head())` and it displays it fine. – Dimitris Poulopoulos Dec 10 '16 at 13:38

0 Answers0