I am trying to create dataframe object from an existing CSV file in python but I am facing problems. I tried to import CSV file into python but I do not know whether I succeeded or not.
>>> import os
>>> userhome = os.path.expanduser('~')
>>> csvfile= userhome + r'\Desktop\train.csv'
>>> with open(csvfile, "r") as f:
After I wrote these statements it did not do anything.
So the First problem - Did I import CSV file to python? And if I did not how do I import?
After that how can I display data from CSV file in python?
I installed pandas
Python IDE 3.6.3 Shell

pandas. there is a function call read_csv which directly loads your csv to dataframe object.r'') will "fix" your use of backslashes. You normally need to use double backslash so you are escaping the escape character. ex:'\\Desktop\\train.csv'. I usually just get the path using unix path descriptions and handle it viaos, likepath = os.path.abspath('/Desktop/train.csv').withstatement is saying "I want you to do something withf" but you never told it what.