Python Forum
CSV file dont open with code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CSV file dont open with code
#1
i have put the following code in python shell and it working fine but not opening in pycharm
import pandas as pd
import numpy as np

df = pd.read_csv('C:\Program Files\PycharmProjects\code examples\StatementImportTemplate.csv')
df.head()
its showing just in output:
"C:\Program Files\python.exe" "C:/Program Files/PycharmProjects/code examples/code practice.py"

Process finished with exit code 0

csv file has two columns one has date other has numbers
Reply
#2
Are you running this as a file ('python "code practice.py"'), right?
Your code is fine.
Try to use print(df.head()) to output head() content in your console (prompt).
Reply
#3
thanks its working
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Locate and open csv file agocomp 3 3,353 Dec-02-2017, 07:02 AM
Last Post: buran
  Open excel file using Python cioer23 8 19,389 Jul-26-2017, 10:57 AM
Last Post: Larz60+
  Access xlsm file that has been open ian 6 4,579 Jun-27-2017, 07:17 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020