0% found this document useful (0 votes)
13 views8 pages

Data Processing and Threading Examples

Uploaded by

hackerduniya0
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 views8 pages

Data Processing and Threading Examples

Uploaded by

hackerduniya0
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

Name: Anurag Verma

Output:

Thread T1: 0 Thread T2: 0 Thread T1: 1

Thread T2: 1 Thread T1: 2


Thread T2: 2

Thread T1: 3
Thread T2: 3
Thread T1: 4

Thread T2: 4
Both threads have finished execution.
Name: Anurag Verma

Output1: Server Side Output: Server is listening...

Connected to ('[Link]', 56789) # (Port may vary)

Client: Hello Server! Client Side Output:


Server: Hello Client! Message received.
Name : Anurag Verma

Output: Data before update: (1,

'Alice', 22) (2, 'Bob', 25)

Data after update:

(1, 'Alice Brown', 23)


(2, 'Bob', 25)

Data after deletion:

(1, 'Alice Brown', 23)


Name: Anurag Verma

Output:1 Email sent

successfully!
Output:2
Webpage Content:
<!doctype html>
<html>
<head>
<title>Example Domain</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body {
background-color: #f0f0f2;
margin: 0;
padding: 0;
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica
Neue", Helvetica, Arial, sans-serif;
}
div {
width: 600px;
margin: 5em auto;
padding: 2em;
background-color: #fdfdff;
border-radius: 0.5em;
box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
@media (max-width: 700px) {
div {
margin: 0 auto;
width: auto;
}
}
</style>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in illustrative examples in documents. You may use this
domain in literature without prior coordination or asking for permission.</p>
<p><a href="[Link] information...</a></p>
</div>
</body>
</html>
Name: Anurag Verma

Output: Data Series:

a 10
b 20
c 30
d 40
e 50
dtype: int64

Data Frame:
Name Age Salary
0 Alice 25 50000
1 Bob 30 60000
2 Charlie 35 70000
3 David 40 80000

Accessing 'Name' column:


0 Alice
1 Bob
2 Charlie
3 David
Name: Name, dtype: object

Accessing row at index 2 using loc:


Name Charlie
Age 35
Salary 70000
Name: 2, dtype: object

Data Frame after adding new column:


Name Age Salary Department
0 Alice 25 50000 HR
1 Bob 30 60000 IT
2 Charlie 35 70000 Finance
3 David 40 80000 Marketing

Data Frame after deleting 'Age' column:


Name Salary Department
0 Alice 50000 HR
1 Bob 60000 IT
2 Charlie 70000 Finance
3 David 80000 Marketing

Accessing salary of Bob:


60000
Name: Anurag Verma

Output: Array 1: [1 2 3 4 5]
Array 2 (Zeros):

[[0. 0. 0.]
[0. 0. 0.]]
Array 3 (Ones):
[[1. 1. 1.]
[1. 1. 1.]
[1. 1. 1.]]
Array 4 (Arange): [1 3 5 7 9]
Array 5 (Linspace): [0. 0.25 0.5 0.75 1. ]
Shape of arr3: (3, 3)
Data Type of arr1: int64
Number of Dimensions of arr2: 2
Size of arr4: 5
Addition: [11 22 33]
Subtraction: [ 9 18 27]
Multiplication: [10 40 90]
Division: [10. 10. 10.]
Dot Product: 140
Mean: 30.0
Median: 30.0
Standard Deviation: 14.142135623730951
Variance: 200.0
Sum of Elements: 150
Original Array:
[[1 2 3]
[4 5 6]
[7 8 9]]
First row: [1 2 3]
Element at (2,2): 5
All rows, second column: [2 5 8]
First two rows:
[[1 2 3]
[4 5 6]]
Name: Anurag Verma

Output: 1D NumPy Array: [10 20

30 40 50]

2D NumPy Array:
[[1 2 3]
[4 5 6]]

Array Shape: (2, 3)


Array Size: 6
Array Data Type: int64

Array after adding 5: [15 25 35 45 55]


Array after multiplying by 2: [ 20 40 60 80 100]

Reshaped Array:
[[10]
[20]
[30]
[40]
[50]]

3x3 Zero Matrix:


[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]

2x4 Ones Matrix:


[[1. 1. 1. 1.]
[1. 1. 1. 1.]]

3x3 Identity Matrix:


[[1. 0. 0.]
[0. 1. 0.]
[0. 0. 1.]]

Sequence using arange(): [1 3 5 7 9]

You might also like