1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Gre4nikov [31]
3 years ago
11

Write a program to read from std_info.txt.

Computers and Technology
1 answer:
slavikrds [6]3 years ago
6 0

Answer:

import pandas as pd

# loads the text file as a pandas dataframe

student_file = pd.read_fwf("std_info.txt")

# opens a new text file if the student_avg does not exist

# the file closes automatically at the end of the with statement

with open('student_avg.txt', 'w+') as file:

   for row in student_file.iterrows():

       file.write(row)

   ee = student_file[student_file['major'=='EE']]

   cpe = student_file[student_file['major'=='CPE']]

   file.write(f'EE average = {ee['EE'].mean()}')

   file.write(f'CPE average = {ee['CPE'].mean()}')

   file.write(f'Total average = {student_file['EE'].mean()}')

Explanation:

The python program gets the text file as a fixed-width file and loads the file as a pandas dataframe. The dataframe is used to get the total average GPA the student GPA and the average GPA of students in various departments. The results are saved in a new file called 'student_avg.txt'.

You might be interested in
How many times do you need to click the Format Painter button to apply copied formats to multiple paragraphs one right after the
const2013 [10]

The answer is (A) Twice

Format painter is that icon tool that looks like a paintbrush that is used to pick up formatting of an existing text and then paints it on the next text you select. If you wish to apply the formatting to more than one element, you should double-click the format painter and press esc key to deactivate.


5 0
3 years ago
Read 2 more answers
What are the different type of computer files?
oee [108]

Answer:

There actually a lot of them: World, PPT, Excell

Explanation:

6 0
2 years ago
Read 2 more answers
PLEASE HURRY PLEASE HELP THIS CLASS ENDS TODAY AND I NEED HELP
Fofino [41]

Answer:

She could have given access to the computer to the techician

Explanation:

"as well as any special settings or configurations she thinks may be relevant." This might inculd any information to hack the computer

6 0
2 years ago
8.
Licemer1 [7]

Answer:

yes

Explanation:

the faster the processor the better the computer loads things and works faster, there's little to no latency depending on the wifi

3 0
2 years ago
Which of the following is NOT true about high-level programming<br> languages?
aniked [119]

Answer:

this can't be answered because you didn't show the "following" answers

8 0
3 years ago
Read 2 more answers
Other questions:
  • We have an internal webserver, used only for testing purposes, at IP address 5.6.7.8 on our internal corporate network. The pack
    15·1 answer
  • Twitter is an example of a __________. social bookmarking website social tagging website microblogging website blogging website
    12·1 answer
  • 1. The future of 2D animation does not include hand-drawing. (1 point)
    13·1 answer
  • In a flow chart, both the decision structure and the repetition structure use the diamond symbol to represent the condition that
    9·1 answer
  • The leader of the team wants to do everything him or herself. They have a very big ego and are difficult to work with. What is t
    14·1 answer
  • 3. Assume a disk drive from the late 1990s is configured as follows. The total storage is approximately 675MB divided among 15 s
    11·1 answer
  • I need some help pleas hurry
    5·1 answer
  • Do you agree with the EU's decision that people should be able to ask Google to remove search results that contain incorrect, un
    11·2 answers
  • What is a Network It’s a system that is used to link two or more computers and name the different types of networks.?
    11·1 answer
  • Write a C function named apply_all that expects two arrays of integers and their sizes and dynamically allocates a new array of
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!