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
Question 18 of 20
olga2289 [7]

Answer:

B. Worked as a sales associate for two years -Apex

Explanation:

5 0
4 years ago
Read 2 more answers
When you have to make a long-distance call, dialing an unfamiliar area code plus a seven-digit number, you are likely to have tr
Mashutka [201]

Answer:

c. short-term

Explanation:

According to a different source, these are the options that come with this question:

a. long-term

b. implicit

c. short-term

d. explicit

This best illustrates the limited capacity of short-term memory. Short-term memory is the most recent information that a person holds in his head. Usually, this corresponds to events that occurred in the last 30 seconds to the last few days. This type of memory stores recent events, as well as sensory data such as sounds.

3 0
3 years ago
In which scenario would instant messaging be more useful than other forms of communication?
ivann1987 [24]
When you're busy doing things and/or be too sick for over the phone communication
7 0
3 years ago
#3: Which combination of statements can be used to express algorithms?
MAVERICK [17]

Answer:

A) Iterative, sequential, and selection

Explanation:

7 0
3 years ago
I need the code for Assignment 5 Animation in Edhesive, its in python code.
insens350 [35]

Answer:116596

Explanation:

4 0
3 years ago
Other questions:
  • Quote one of morrie's aphorisms and explain what you think it means (page 18).
    14·1 answer
  • Need help with this file and due today!!
    6·1 answer
  • What could break the circuit between your home and an electric power plant?
    15·2 answers
  • The connectors on the computer allow you to plug in devices such as keyboards and printers. what are these called?
    15·1 answer
  • is a shell program in Windows that holds individual utilities called snap-ins, designed for administration and troubleshooting.
    11·1 answer
  • You are using a PowerPoint template from your school to present your research findings in front of the class. What would you do,
    13·2 answers
  • How do you mark someone brainliest? The person with the best explanation gets brainliest.
    11·2 answers
  • FIRST AMSWER GET BRAINLIEST​
    13·1 answer
  • Memory cards from your cameras (SD cards) and flash drives are examples of __________.
    13·1 answer
  • Fill in the blank to complete the sentence.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!