-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsv1.py
More file actions
35 lines (26 loc) 路 1.22 KB
/
Copy pathcsv1.py
File metadata and controls
35 lines (26 loc) 路 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
CSV(Comma's separated value)
It is a simple file format used to store tabular data , such as a spreadsheet or database .
A csv file stores tabular data (numbers or text ) in plain text .each line of the field is a sata record . Each record consists of one or more fields
, separated by commas . The use of the comma as a field separator is the source of the name for this file format.
For working CSV file in python , there is a built in module called csv
microsoft ecel == document == save extension csv and
save as type :CSV(Comma delimited)
"""
import pandas as pd
# df = pd.read_csv(r"C:\Users\Pushpendra\Documents\csv_python_Dhruv.csv")
# print(df)
# df = pd.read_csv("C:/Users/Pushpendra/Documents/csv_python_Dhruv.csv")
# print(df)
# specific rows
# df = pd.read_csv("C:/Users/Pushpendra/Documents/csv_python_Dhruv.csv" , nrows=3)
# print(df)
# without header
# df = pd.read_csv("C:/Users/Pushpendra/Documents/csv_python_Dhruv.csv" , header=None)
# print(df)
# without index
# df = pd.read_csv("C:/Users/Pushpendra/Documents/csv_python_Dhruv.csv" , index_col=0)
# print(df)
# new column name
# df = pd.read_csv("C:/Users/Pushpendra/Documents/csv_python_Dhruv.csv" , skiprows=1 , names=['a','b','c','d','e'])
# print(df)