Summary

1. Pandas is the most popular library in the scientific Python ecosystem for doing data analysis.

2. A Series type object is pandus data structure that represents a one-dimensional array-like object containing an array of data (of any NumPy supported data type) and an associated array of data labels, called its index

3.A Series type object can be created using panda.Series) where data may be specified as a sequence of any type or ndarrays.

4. Series object’s indexes are not necessarily from 0 to n-1 always.

5.You can use numpy.NaN to add missing data. Common Series attributes are: index, values, drype, shape, nbytes, ndim, size, itemsize, hasnans, empty etc.

6.A slice object is created from Series object using a syntax of

7.Vector operations mean that if you apply a function or expression then it is individually applied on each item of the object.

8.When you perform arithmetic operations on two Series type objects, the data is aligned on the basis of maching indexes and then performed arithmetic: for non-overlapping indexes, the arithmetic operations

9.A DataFrame is a two-dimensional labeled array like, pandas data structure that stores an ordered collection.

A dataframe object is created uning pandas.DataFrame() and the values to it are passed in a two dimensional sequence such as a 2D adarray or dictionary having listvindarrays/dictionary/Series etc as values or anotherdataframe object.

10.Common dataframe objects include: index, columns, axes, dtypes, size, shape, values, empty, ndim.

11.Trampose of a dataframe is available through non-existing column, it will add a new column.

12.A column can be deleted using del command.

Answer the Following Question.

Q.1 Define Pandas?

Ans 1 :- Pandas or Python Pandas-is Python’s library for data analysis. Pandas has derived its name from. “panel.data system”Pandas makes available various tools for data analysis and makes it a simple and easy process as compared to other available tools. The main author of Pandas is Wes McKinney.Pandas is an open source, BSD library built for Python programming language. Pandas offers high-performance, easy-to-use data structures and data analysis tools

Q.2 Define Data Structure?

Ans 2 :-Data Structures refer to specialized way of storing data so as to apply a specific type of functionality on them.

Q.3 Difference between Series and DataFrame?

 

 

Series 

1.Series is a 1-Dimensional Array.

2.Series is Homogeneous in nature.ex :- All element must be of same datatype. 

3.Series is a Size – Immutable. Size of a Series object once created, cannot change.

DataFrame

1.DataFrame is a 2-Dimensional Array.

2.DataFrame is Hetrogenous in  nature ex :- Object can have different data type.

3. Data frame is a Size – Mutable . Size of Data Frame object once created can be cahnge in the place.

 

Q.4 Define Series ? 

Ans :-A Series is a Pandas data structure that represents a one dimensional array-like object containing an array of data (of any NumPy data type) and an associated array of data labels, called its index.

Q.5 Different ways to create a Series?

Ans 5 :-There are different ways in which a series can be created in Pandas.

Creation of Series from Scalar Values

Creation of Series from NumPy Arrays

Creation of Series from Dictionary

Q.6 How to access Element of Series?

Ans 6 :-There are two common ways for accessing the elements of a series: Indexing and Slicing.

Q.7 What are different attribute of Series?

 Ans :- Different Attribute of a Series are name , index.name , values,size,empty.

Q.8 What are different methods of Series?

Ans :- Different methods of Series are head(n) , tail(n) and count(n).

Q.9  Define Data Frame?

Ans :-Pandas store such tabular data using a DataFrame. A DataFrame is a two-dimensional labelled data structure like a table of MySQL. It contains rows and columns, and therefore has both a row and column index.

Q.10 Different ways to create a Data Frame?

Ans :-

There are a number of ways to create a DataFrame.  

Creation of an empty DataFrame 

Creation of DataFrame from NumPy ndarrays

Creation of DataFrame from List of Dictionaries

Creation of DataFrame from Dictionary of Lists

Creation of DataFrame from Series

Creation of DataFrame from Dictionary of Series