0% found this document useful (0 votes)
13 views1 page

Task1.ipynb - Colaboratory

Uploaded by

Mario
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)
13 views1 page

Task1.ipynb - Colaboratory

Uploaded by

Mario
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/ 1

Smeet Mutha Class:R&A

Roll No:PB39 Div: 02 Task1.ipynb - Colaboratory

import numpy as np

random_array = np.random.randint(1, 101, size=(3, 4))


print(random_array)

[[41 63 43 30]
[61 67 11 85]
[36 54 3 24]]

mean_value = np.mean(random_array)
median_value = np.median(random_array)
std_deviation = np.std(random_array)

print("Mean:", mean_value)
print("Median:", median_value)
print("Standard Deviation:", std_deviation)

output Mean: 43.166666666666664


Median: 42.0
Standard Deviation: 23.07897070687705
Code Text

reshaped_array = random_array.reshape((2, 6))


print(reshaped_array)

[[41 63 43 30 61 67]
[11 85 36 54 3 24]]

maximum_value = np.max(reshaped_array)
minimum_value = np.min(reshaped_array)

print("Maximum value:", maximum_value)


print("Minimum value:", minimum_value)

Maximum value: 85
Minimum value: 3

reshaped_array[reshaped_array % 2 == 0] = -1

print(reshaped_array)

[[41 63 43 -1 61 67]
[11 85 -1 -1 3 -1]]

https://colab.research.google.com/drive/1G4lv-8IaHR55YuURDsvPaf1Ii6Dif5yf#printMode=true 1/1

You might also like