Ba Ca

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Course Code: MGNM801 Course Title: Business Analytics 1

Course Instructor: Aman Panda Academic Task No.: CA2


Academic Task Title: Python
Date of Allotment: December 22, 2022 Date of submission: December 29, 2022
Student’s Name: U Raj Kumar Patro

Student’s Reg. no:12210495

Evaluation Parameters: There would be one evaluation parameter, i.e., Project Report. Each group will
submit one common report (uploaded by all the group members)

Declaration:

I declare that this Assignment is our individual work. We have not copied it from any
other student’s work or from any other source except where due acknowledgement
is made explicitly in the text, nor has any part been written for me by any other person.

Evaluators’ comments (For instructor’s use only)


General Observations Suggestions for Best part of assignment
Improvement

Evaluator’s Signature and Date:


Marks Obtained: Marks:30
What is Pandas?
The most often used open-source Python library for data science, data analysis, and machine
learning activities is called Pandas. It is constructed on top of NumPy, a different package that
supports multi-dimensional arrays. In the Python ecosystem, Pandas is one of the most widely
used data-wrangling packages. It integrates well with a variety of other data science modules,
and it is typically available in all Python distributions, including those sold by commercial
vendors like Active State’s Active Python and those that come with your operating system.

Pandas Be Used For With DataFrames:


Many of the tedious, time-consuming activities involved in working with data are made simple
with Pandas, including:
➢ Data Purging
➢ Data Entry
➢ Normalization Of Data
➢ Connects And Combines
➢ Visualisation Of Data
➢ Statistic Evaluation
➢ Data Analysis
➢ Data Loading And Archiving

Read data or read csv file:

For the data, I created a fake database for example, and converted it into CSV file so that
google colab can read my file. For reading data, we have to import pandas as pd other wise pd
is not defined d will show as an error. After that just we have to write pd.read_csv as we want
to read the file and we have to mention the file name in () so that we can specify the file and
we also have to use "".
Separate the two columns:

DataFrame & Series functions

A DataFrame is a data structure that organizes data into a 2-dimensional table of rows and
columns, much like a spreadsheet. DataFrames are one of the most common data structures
used in modern data analytics because they are a flexible and intuitive way of storing and
working with data.
Functions of DataFrame:
• Read_Csv() This Is One Of The Most Crucial Pandas Methods In Python. ...
• Head() Head(N) Is Used To Return The First N Rows Of A Dataset. ...
• Describe() Describe() Is Used To Generate Descriptive Statistics Of The Data In A
Pandas Dataframe Or Series
• Memory_Usage()
• Astype()
• Loc[:]
• To_Datetime()
• Value_Counts()

Here both DataFrame and Series I take similar data structures that’s why both the result came
the same but if we take a look we can find the difference between these two and we can find
out why we use DataFrame and Series for different reasons. Technically, Pandas Series is a
one-dimensional labelled array capable of holding any data type. So, in terms of Pandas
DataStructure, A Series represents a single column in memory, which is either independent or
belongs to a Pandas DataFrame.
Matplotlib:
Matplotlib is a comprehensive library for creating static, animated, and interactive
visualizations in Python. Matplotlib makes easy things easy and hard things possible.

• Create publication quality.


• Make interactive figures that can zoom, pan, and update.
• Customize visual style and layout.
• Export to many file formats.
• Embed in JupyterLab and Graphical User Interfaces.
• Use a rich array of third-party packages built on Matplotlib.

Simple line graph using weather_data.csv file


Scatter plot using RESULT REPORT.CSV file:

Bar Chart using RESULT REPORT.CSV file:


Histogram using RESULT REPORT.CSV file

Labels:
The Label is used to specify the container box where we can place the text or images. This
widget is used to provide the message to the user about other widgets used in the python
application. There are the various options which can be specified to configure the text or the
part of the text shown in the Label. A Label is a Tkinter Widget class, which is used to display
text or an image. The label is a widget that the user just views but not interact with. There is
hardly any book or introduction into a programming language, which doesn't start with the
"Hello World" example.
Labels: Scatter plot

SAVE the GRAPHS using an example:


PLOTLY

The plotly Python library is an interactive, open-source plotting library that supports over 40
unique chart types covering a wide range of statistical, financial, geographic, scientific, and 3-
dimensional use-cases. Plotly provides online graphing, analytics, and statistics tools for
individuals and collaboration, as well as scientific graphing libraries for Python, R, MATLAB,
Perl, Julia, Arduino, and REST.

Line Graph:
Scatter Plot:

3D Graph using wind()

You might also like