Actuators and Drivers
Actuators and Drivers
Pandas
• Pandas is an open – source Python library that has functions
providing high performance data manipulation and analysis. Prior
to Pandas, Python had very little contribution toward data
analysis. But with Pandas solved, Python can be used to load,
prepare, manipulate, model and analyze data.
Data frame- A key component of Python
• A data frame is a two-dimensional data structure in which data are
organized in a tabular fashion using rows and collumns. Basic
features of data frame can be given as
• Columns of different data types
• Size is mutable
• Data frame has labelled axes for rows and columns
• Arithmetic operations can be performed on rows and columns
Creating a data frame
Example 1
Example 2
Example 3
Pandas Dataframe functions and attributes
Functions and attributes
Read And Write Csv File Using Pandas Showing
Examples
Introduction to Pandas and CSV Files
• CSV (Comma-Separated Values) files are widely used for data storage and
exchange due to their simplicity.
Reading a CSV File
• This function takes the file path as an argument and returns a DataFrame.
• After loading the CSV file into a DataFrame, you can display the first few
first few rows using `df.head()`.
• For instance, calling `df.head()` will show the first five rows of the
DataFrame.
Writing to a CSV File
• You can write a DataFrame to a CSV file using the `to_csv()` method.
• This method allows you to specify the filename and various options, such
as including headers.
• Pandas provides options to deal with missing values when reading CSV
files.
• You can use the `na_values` parameter to specify additional strings to treat
as NaN.
• This can be useful when the target application does not require headers.
• The `read_csv()` function has several advanced options for reading data.
• You can specify the `usecols` parameter to read only specific columns from
the CSV file.