Reputation: 1249
I am using Spyder as my python IDE.
I tried run this python code:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
path = os.getcwd() + '\ex1data1.txt'
data = pd.read_csv(path, header = None, names = ['Population', 'Profit'])
data.head()
In theory it is supposed to show me a table of data since I am using
data.head()
at the end
but when I run it, it only shows :
I thought it was supposed to display a new window with the data table.
What is wrong?
Upvotes: 0
Views: 204
Reputation: 1628
You want to print your data.head() so do that...
print(data.head())
Upvotes: 1
Reputation: 1672
You are calling data.head()
in .py
script. The script is supposed to only read the data, not print it. Try print(data.head())
Upvotes: 2