The client will request a service from the server and the server will process the service-request and then send a reply to the client.
In this lab project:You are a given a CSV file, and you should copy the file into some directory on the server.
Using Python- you will import the CSV file and analyse the data frames (i.e. data structured as columns and rows).
Tasks:
1. Write both TCP client and TCP server in Python version 3.8 or above.
2. Test the network connectivity between TCP client and TCP server.
3. Import the CSV file into the TCP server.
4. Find the number of rows and columns of the data set, and display the results on the TCP client machine.
5. Output the 2nd row on the TCP client machine.
6. Find the averages(mean) of the statistics for NBA players and display the results on the TCP client machine.
Print out:
1. The Python code for the above tasks and
2. Screen shots of results for tasks (2-6) above.
import pandas as pd
df = pd.read_csv(r"C:\Users\Ron\Desktop\data.csv")
mean = df['Salary'].mean()
sm = df['Salary'].sum()
mx = df['Salary'].max()
mn = df['Salary'].min()
cnt = df['Salary'].count()
median = df['Salary'].median()
std1 = df['Salary'].std()
var1 = df['Salary'].var()
sum_group = df.groupby(['Country']).sum()
count_group = df.groupby(['Country']).count()
print ('Mean salary: ' + str(mean))
print ('Sum of salaries: ' + str(sm))
print ('Max salary: ' + str(mx))
print ('Min salary: ' + str(mn))
Comments
Leave a comment