0% found this document useful (0 votes)
9 views4 pages

Artificial Intelligence & BA - Assignment-3

Uploaded by

girijamma.ha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

Artificial Intelligence & BA - Assignment-3

Uploaded by

girijamma.ha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Job Role - AI-Business Intelligence Analyst

Practical Questions and Assignments

Module 3 : Statistical Tools and Usage (Jupyter notebook /


R programming)
Jupyter Notebook (Python)

1. **Basic Arithmetic and Functions:**


How do you calculate the mean of a list of numbers `[10, 20, 30, 40, 50]` in a Jupyter Notebook using Python? Write
the code to perform this calculation.

2. **Using Libraries:**

Import the `numpy` library in a Jupyter Notebook and create a NumPy array with the values `[1, 2, 3, 4, 5]`. How do
you find the standard deviation of this array using `numpy`?

3. **Data Analysis with Pandas:**

Load the following dataset into a Pandas DataFrame in a Jupyter Notebook:

For Private Circulation Only


data = {'Name': ['Alice', 'Bob', 'Charlie'],

'Age': [25, 30, 35]}

Display the Data Frame and calculate the average age.

4. **Plotting with Matplotlib:**

Create a simple line plot using Matplotlib in a Jupyter Notebook.

Plot the points (1, 2), `(2, 4)`, and `(3, 6)`.

5. **Basic Data Frame Operations:**

Given the following Pandas Data Frame:

import pandas as pd df = pd.Data Frame({'A': [1, 2, 3], 'B':

[4, 5, 6]})

What is the code to calculate the sum of each column?

R Programming

1. **Basic Arithmetic and Functions:**

How do you calculate the mean of a vector `c(10, 20, 30, 40, 50)` in R? Write the code to perform this calculation.

2. **Using Libraries:**

Install and load the `ggplot2` library in R. Write the code to create a simple scatter plot of `x = c(1, 2, 3)` and `y = c(2,
4, 6)` using `ggplot2`.

3. **Data Analysis with Data Frames:**

Create a data frame in R with the following data:

For Private Circulation Only


Name <- c("Alice", "Bob", "Charlie") Age <- c(25,

30, 35) df <- data.frame(Name, Age)

Display the data frame and calculate the average age.

4. **Plotting with Base R:**

Create a bar plot in R for the vector `c(5, 10, 15)` with the labels `c("A", "B", "C")`.

5. **Basic Data Frame Operations:**

Given the following data frame in R:

df <- data.frame(A = c(1, 2, 3), B = c(4, 5, 6))

What is the code to calculate the sum of each column?

Data Visualisation using Python / R

1. **Bar Plot:**

Create a bar plot in Jupyter Notebook using Matplotlib for the following data:

categories = ['A', 'B', 'C'] values = [10, 15, 7]

Label the x-axis as "Categories" and the y-axis as "Values". What is the code to generate this bar plot?

2. **Histogram:**

Generate a histogram of the following data in Jupyter Notebook using Matplotlib:

data = [5, 7, 8, 5, 6, 7, 9, 10, 6, 7]

Use 5 bins and label the x-axis as "Value" and the y-axis as "Frequency". What is the code?

3. **Pie Chart:**

Create a pie chart in Jupyter Notebook using Matplotlib for the following data:

sizes = [20, 30, 50] labels = ['A', 'B','C']

Add a title "Distribution of Categories". What is the code to generate this pie chart?
For Private Circulation Only
4. **Box Plot:**

Using the following data, create a box plot in Jupyter Notebook with Matplotlib:

data = [5, 7, 8, 6, 5, 7, 9, 10, 6, 7]

Label the y-axis as "Values". What is the code to generate this box plot?
***********************

For Private Circulation Only

You might also like