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
You are the manager and an employee shows up for his shift dressed inappropriately for work. What should you do?
yarga [219]

Most managers see inappropriate dressing every day. Some are left angered while some are confused as to what is the right way to approach such situations. What follows next needs to be professional oriented. Being the manager, I would start by finding out what the appropriate dressing policies are. Some companies might have dress code policies while others might not. Assuming that this company has, I would read these policies carefully. The next thing that is required from me is to have a small conversation with the employee discretely. As professional as I can be, I will mention how I feel his or her dress code is inappropriate and try to summon the employee by asking him or her whether they are fully aware of the appropriate dress code. I will try to agree with the employee on what is appropriate and what is not. If we agree, requesting the employee to home and change clothes is unnecessary, but if the need to do that arises, I would consider that to be an option.

7 0
2 years ago
Read 2 more answers
Someone help me out eh?
Elodia [21]

Line 4

It should be font-size: 15px

Also there should be curly braces in line 5.

6 0
2 years ago
Read 2 more answers
____allow(s) visually impaired users to access magnified content on the screen in relation to other parts of the screen.
Ksenya-84 [330]
I think the answer is Screen Magnifiers
5 0
3 years ago
Which will you see on the next line 9, 2, 3.5, 7]
elena55 [62]

Answer:

plenipotentiaries. It was by far the most splendid and

important assembly ever convoked to discuss and

determine the affairs of Europe. The Emperor of

Russia, the King of Prussia, the Kings of Bavaria,

Denmark, and Wurttemberg, all were present in

person at the court of the Emperor Francis I in the

Austrian capital. When Lymie put down his fork and

began to count them off, one by one, on the fingers

of his left hand, the waitress, whose name was Irma,

thought he was through eating and tried to take his

plate away. He stopped her. Prince Metternich (his

right thumb) presided over the Congress, and

Prince Talleyrand (the index finger) represented

France? please let me know if this is the answer you were looking for!!

5 0
3 years ago
Read 2 more answers
8.2 code practice edhesive?
Illusion [34]

Answer:

temperatures = []

i = 0

while i < 5:

   try:

       t = int(input('Enter a temperature: '))

       temperatures.append(t)

       i += 1

   except ValueError:

       print('Enter a number')

print(temperatures)

Explanation:

Hope this helps!

6 0
3 years ago
Other questions:
  • The item that is clicked in a JList can be retrieved using the _____ method of JList.
    8·1 answer
  • How many ways can you add an image into google slides?
    8·1 answer
  • A file name extension provides what information about a file?
    10·2 answers
  • A potential threat to administrators’ ability to manage the correctional system is
    12·1 answer
  • How can I collect tweets from different accounts concurrently and categorize the tweets in a corpus?
    15·1 answer
  • If you want Nud3s add me on sc Kermit4lyfe1
    11·2 answers
  • Wrtie down some containerization technology.
    11·1 answer
  • Match the organelles to their functions.
    6·1 answer
  • Your friend has a great idea for a new app, and she shows you a document that outlines what the app will do. This document is an
    6·1 answer
  • Queries are questions true or false?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!