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
Complete the steps to evaluate the following
kirill115 [55]

Answer:

log base 3a= -0.631.log a/3 base 3

Now, -log m= log 1/m

hence,

log base 3a= 0.631.log 3/a base 3

log base 3a/log 3/a base 3 =0.631

log base 3 ( a.3/a) =.631 since, log m/logn =log n(m)

log base 3 3=0.631

Hence, answer is log base 3 3=0.631

Explanation:

Please check the answer section.

3 0
3 years ago
Read 2 more answers
What is common for all machines​
Fed [463]

Answer:

the question is a bit vague, but all machines exist to serve a purpose, or to do or accomplish a certain task.

6 0
3 years ago
Read 2 more answers
Tips to identify email scams.
malfutka [58]

Answer:

Explanation:

dont open or sign up to anything that seems to good to be true

7 0
3 years ago
List the 4 Fundamental Storage Technologies​
grigory [225]

Answer:

Magnetic Storage. Magnetic storage encodes data in patterns of positive and negative magnetic polarity on some magnetic medium like organic metal. ...

Optical Storage. Optical storage technology use laser/optical reflection phenomenon to read or write data. ...

Solid State storage.

Explanation:

Hope this help!!

8 0
3 years ago
Read 2 more answers
If you don’t have a paper copy of the FAFSA form, how else can you fill it out?
Ronch [10]
Go on your school computer, and find a copy of the form. Then print it from the school printer.
3 0
3 years ago
Read 2 more answers
Other questions:
  • How can styles be used in Word? Check all that apply. to standardize the font size of a title in a Word document to standardize
    9·2 answers
  • On five lane roadways, the center lane is designated for __________ and is used by vehicles traveling in both directions.
    14·1 answer
  • . Convert BAC4 from hexadecimal to decimal. Show your work.
    9·1 answer
  • True or false? pressing Ctrl and S is a shortcut for saving
    15·2 answers
  • What are the components inside the case typically draw power from a cable connected to the motherboard instead of being connecte
    6·2 answers
  • During the _____it is important to figure out how the test will be scored.
    9·1 answer
  • Find the domain and range of Y=x^3-9/x-3​
    14·1 answer
  • Computer programming 5
    10·1 answer
  • Is a system software that manages the hardware resources and provides services 5o the application software
    6·1 answer
  • What program command saves a copy of a file under a different name
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!