PP Manual Exp No. 07
PP Manual Exp No. 07
LABORATORY MANUAL
SHEGAON - 444 203
PRACTICAL EXPERIMENT INSTRUCTION SHEET
EXPERIMENT TITLE: Write a program to create a data frame from .csv file and do operations on
it.
01 AIM: Write a program to create a data frame from .csv file and do operations on it.
02 APPARATUS/SOFTWARE USED: PC with Python 3.
03 FORMULA: Not applicable
Before diving into the details of creating a dataframe from a CSV file, let's first define what a dataframe is
and what a CSV file is.
A dataframe is a two-dimensional, size-mutable, tabular data structure with columns of potentially different
types. It is similar to a spreadsheet or SQL table, and is commonly used to store and manipulate data in
Python.
A CSV (comma-separated values) file, on the other hand, is a plain text file that stores data in a tabular
format, with each row representing a record and each column representing a field. CSV files are a common
way to store data because they are easy to read and write, and can be opened in many different applications,
including Excel and Python.
Program:
import pandas as pd
# Read the CSV file into a DataFrame
df = pd.read_csv('example.csv')
Program:
import pandas as pd
Conclusion: In short, using pandas to create a DataFrame from a .sv file enables efficient data manipulation
and analysis. This versatile tool facilitates various operations such as cleaning, transforming, and
visualizing data, empowering users to derive valuable insights and make informed decisions swiftly.