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
Match the description to the step in troubleshooting.
Digiron [165]
It should go 4 5 3 2 1
5 0
3 years ago
Meg[] elements = {new Lois(), new Stewie(), new Meg(), new Brian()}; for (int i =0; i
Stells [14]

Complete question is attached as snapshot.

Answer:

This will result in a compilation error.

Here's the inheritance hierarchy:

Meg -> Lois -> Brian -> Stewie

Now Meg has 2 public Fxns, a() and toString().

Lois inherits from Meg and all its public functions as well but, overrides the a() fxn of its super class.

So finally Lois has fxns a(), b() and toString().

Brian extends Lois and inherits all the above listed fxns of Lois, but overrides the b() and toString() fxns.

Stewie extends Brian and inherits all the fxns of Brian, but overrides the a() and toString() fxns.

In the Main driver fxn, we call a() and b() methods of all these classes but, the base class Meg has no b() and it is not extending any class so its not available in its scope.

This results in a compilation error.

Explanation:

7 0
3 years ago
Cindy visits her favorite website on a lunch break using a hospital computer. After she downloads a file, she notices that the c
TiliK225 [7]

<u>Explanation:</u>

<em>Remember, </em>Malware is a word coined from the words Malicious-Software (Mal...ware). Thus, Malware could be defined as software that is intentionally designed by cybercriminals to gain access or cause damage to a computer or network.

a. Cindy may learn the difference between these two techniques used to create a malware attack:

  • through downloads from malicious websites: An attacker may design a malicious website; in which unsuspecting users who visit the site may click to download certain files, but these are actually malware software been installed.
  • through malicious emails: This email may contain attachments which if opened or downloaded by an unsuspecting user would infect their computer with malware.

b. Here are some common suggestions;

  • Never open attachments from strange email addresses.
  • install a paid antivirus software.
  • be mindful of websites with too many ads.
4 0
3 years ago
Written one please answer
Zinaida [17]

Answer:

So where the question????????

8 0
2 years ago
You're using disk management to view primary and extended partitions on a suspect's drive. the program reports the extended part
kodGreya [7K]

The best assumption to make is that there is a hidden partition and the drive needs to be further searched.

5 0
3 years ago
Other questions:
  • According to the Big Five Factors model, all but _____ are categories.
    11·1 answer
  • Which is the correct formula to add the values in cells A1 and B1?
    11·2 answers
  • Select the correct answer.
    13·1 answer
  • Andrew has data in cell E14 and the cell should be blank. Andrew should _____.
    15·2 answers
  • What icon is usually used to indicate an attachment feature?
    14·2 answers
  • Which type of portfolio might a young investor who is not afraid of risk choose?
    12·1 answer
  • In order to send a photo in a text message from your cell phone to your cousin's cell phone who lives in New Zealand, is it nece
    8·1 answer
  • Describe the user interface in other high-technology devices commonly found in the home or office, such as a smartphone, HD tele
    13·1 answer
  • Where to store <br> ammunition
    5·1 answer
  • In company a, there is a team that performs day-to-day it operations with a focus on security. they are responsible for a wide r
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!