0% found this document useful (0 votes)
5 views3 pages

Day 1 Work PYTHON

The document outlines a Python intern assignment focused on introducing NumPy, a library for numerical operations. It includes installation instructions, tasks for creating and manipulating 1D and 2D NumPy arrays, and performing basic statistical operations. The expected deliverables are a Python file or Jupyter Notebook demonstrating these concepts, to be completed in two days.

Uploaded by

oknamemaybe
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)
5 views3 pages

Day 1 Work PYTHON

The document outlines a Python intern assignment focused on introducing NumPy, a library for numerical operations. It includes installation instructions, tasks for creating and manipulating 1D and 2D NumPy arrays, and performing basic statistical operations. The expected deliverables are a Python file or Jupyter Notebook demonstrating these concepts, to be completed in two days.

Uploaded by

oknamemaybe
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/ 3

DATAWIND DIGITAL SERVICES​

PYTHON INTERN ASSIGNMENT | DAY 1

Day 1 Task: Introduction to NumPy

Objective:​
This task will introduce you to the basics of NumPy, a Python library used for working with
arrays and numerical operations. You'll learn how to create NumPy arrays and perform simple
operations on them.

Installation Process

❖​ Install Python:
➢​ If you don’t have Python installed, download and install it from Python’s official
website.
❖​ Install NumPy:

Once Python is installed, open your terminal (or command prompt) and run:​
pip install numpy

Work Details

1. Creating NumPy Arrays

●​ Objective: Learn how to create NumPy arrays from lists.

Steps:

●​ Open a new Python file (numpy_example.py) or Jupyter Notebook


(numpy_example.ipynb).

Create a NumPy array from a Python list:​


import numpy as np
# Create a 1D NumPy array
arr = np.array([1, 2, 3, 4, 5])
print("1D NumPy Array:")
print(arr)

●​ Explanation: You have created a simple one-dimensional array with integers.


2. Array Operations

●​ Objective: Learn basic operations on NumPy arrays.

Steps:
●​ Add 5 to every element of the array:​
arr_plus_5 = arr + 5
print("Array after adding 5:")
print(arr_plus_5)

●​ Multiply every element of the array by 2:​


arr_times_2 = arr * 2
print("Array after multiplying by 2:")
print(arr_times_2)

●​ Explanation: These are basic arithmetic operations that apply to all elements of the
array.

3. Multi-dimensional Arrays

●​ Objective: Learn how to create and work with 2D arrays (matrices).

Steps:
●​ Create a 2D NumPy array (a matrix):​
matrix = np.array([[1, 2, 3], [4, 5, 6]])
print("2D NumPy Array (Matrix):")
print(matrix)

●​ Access an element in the 2D array:​


element = matrix[1, 2] # Access the element at row 1, column 2 (value
6)
`​ print("Element at row 1, column 2:", element)

●​ Explanation: You created a 2D array and accessed an element using indexing.

4. Basic Statistical Operations

●​ Objective: Learn how to compute basic statistics on NumPy arrays.

Steps:

●​ Find the mean of the array:​


mean_value = np.mean(arr)
print("Mean of the array:", mean_value)
●​ Find the sum of all elements:​
sum_value = np.sum(arr)
print("Sum of the array:", sum_value)

●​ Explanation: These are basic statistical operations you can perform on NumPy arrays.

Expected Deliverables:

❖​ A Python file (numpy_example.py) or Jupyter Notebook (numpy_example.ipynb)


containing:
➢​ Code to create 1D and 2D NumPy arrays.
➢​ Code for performing basic operations (addition, multiplication) on NumPy arrays.
➢​ Code for accessing elements and performing simple statistics.

Example Task Outcome:

●​ A 1D NumPy array created and manipulated with addition and multiplication.


●​ A 2D NumPy array created and accessed.
●​ Basic statistics such as mean and sum calculated on the array.

Duration:

Complete this task in 2 Days.

Good luck! Feel free to ask for help if you have any questions or need clarification.

You might also like