Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to do the following: Read students' result data from file result.csv, display: students with exam score < 48. Please also save the students'

I need to do the following:

Read students' result data from file result.csv, display:

  • students with exam score < 48. Please also save the students' records to a file called failedhurdle.csv.
  • students with exam score < 48 and total > 50
  • students with exam score > 100

Sample code for as far as I gotten:

import csv

import pandas as pd

import numpy as np

df = pd.read_csv('result.csv')

columns = df.columns

with open('result.csv') as myFile:

reader = csv.reader(myFile)

for row in reader:

print(row)

Now this only prints all the number in the file but how can I just read those specific scores and write to a new file? Any guidance would be great.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Programming questions