Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started