Reading files
The most common format is csv. Let's read it. You can download the file here.
Download and put it in the same folder from where you run your jupyter notebook
Comments (single line) start with a # in python
I import the pandas library (required for reading files)
You could change the filename to anything. If its somewhere else in your computer, include the entire path
The
Running the above should give you the following output
View attachment 27226
The most common format is csv. Let's read it. You can download the file here.
Download and put it in the same folder from where you run your jupyter notebook
Python:
import pandas as pd
filename = 'SBIN.csv'
df = pd.read_csv(filename, parse_dates=['Date'])
df
I import the pandas library (required for reading files)
You could change the filename to anything. If its somewhere else in your computer, include the entire path
The
read_csv
function reads the file and parses it into a dataframe for easy analysis. parse_dates indicates that the Date column should be regarded as dateRunning the above should give you the following output
View attachment 27226
Am stuck here ...file not found error comes.....I put sbi csv file in C drive where my other pair trading stockdata file have...Is I need this file to put in anaconda folders its in D drive?