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
Which of the statements below is true?
emmainna [20.7K]

The given statement that is true is; B: The Formatting, Standard, and Drawing toolbars are displayed.

<h3>Which statement is true of microsoft word?</h3>

In Microsoft word, there are different toolbars that are useful in operation. Now, from the given image from Microsoft word, we can see that toolbar is clicked. However in the fly-down from it, we see that the standard, formatting and drawing toolbars are ticked and as such they are the ones displayed.

Looking at the options, the correct one is Option B because it tells us that Formatting, Standard, and Drawing toolbars are displayed.

Read more about a true statement at; brainly.com/question/25605883

8 0
2 years ago
What is the full form of flops​
kobusy [5.1K]

Answer:

<em>Floating Point Operations Per Second</em> (FLOPS)

Explanation:

<em>Floating Point Operations Per Second</em> (FLOPS) is a measure of a computer’s performance, especially in fields of scientific calculations that make heavy use of floating-point calculations. Floating-point operations include any operations that involve fractional numbers.

8 0
3 years ago
Read 2 more answers
What is the worst case running time of a linear search?
shtirl [24]

Answer:

The worst case running time of a linear search is O(N).

Explanation:

In a linear search, you will run the program looking at each array position until you find your desired information.

The best case scenario is when you find it at the first position.

The worst case scenario is when you find the value at the last array position. So, in a N-length array, the information is at position N. This means that the worst case running time of a linear search is O(N).

3 0
3 years ago
Read 2 more answers
. The BEST description of a proprietary database is one that
AVprozaik [17]
Is free to the public
8 0
3 years ago
How do you level up on this thing?
Gala2k [10]
You just have to answer a lot of questions, and get voted "Brainliest" by the person who posts the question
6 0
3 years ago
Other questions:
  • What is the outlined area called?
    6·1 answer
  • What does a file extension tell you?
    14·1 answer
  • The problem of using IP numbers for addressing hosts in the Internet are resolved using
    5·1 answer
  • In Windows Vista, the Run command can be found in which application?
    6·1 answer
  • If you press the key corresponding to letter A on the keyboard, what process is carried out inside the CPU to display the letter
    10·1 answer
  • Several new projects are being staffed by outside contractors who will be working on servers in the contractors’ office, not in
    5·2 answers
  • Calvin needs to design a simple yet professional interface for his users. Which option should he implement?
    9·2 answers
  • What is a document you can create with word-processing software
    9·1 answer
  • Explain the working principal of computer system with suitable diagarm​
    10·2 answers
  • You want to connect to a user desktop to review windows 10 configuration settings when the user is not present. which technology
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!