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
Write python code that does the following.
Mariulka [41]

Answer:

the answers are in front of you it is correct to follow the steps

¯\_(ツ)_/¯:

5 0
3 years ago
How does an individual's access to a wide range of online services affects their ability to operate safely in the digital world.
S_A_V [24]
Nothing online is safe anymore!!!! People and even the government can get hacked easily with today's technology.You can search someone easily on websites like Google or Facebook and even read someone's tweets on Twitter because their account is not private. But what's the point of saying private if they can easily get hacked by someone. There is no safety these days that is why you have to be careful with what you post on the internet in general.
6 0
3 years ago
What is the full word of"VPN"?​
pantera1 [17]

Answer:

Virtual Private Network.

Explanation:

A VPN helps protect your data when accessing the internet. It usually scrambles your IP location and encrypts your data.

5 0
3 years ago
Read 2 more answers
(Java) Write a program that accepts a number of minutes and converts it both to hours and days. For example, 6000 minutes is 100
iogann1982 [59]
Import java.util.Scanner;
public class MinutesConversion {
private static Scanner inputDevice;
public static void main(String[] args) {
int minutes, hours;
float days; // float for decimal point

inputDevice = new Scanner(System.in);
System.out.println("Please enter minutes for conversion >> ");
minutes = inputDevice.nextInt();
hours = minutes / 60;
days = hours / 24.0f;


System.out.println(+ minutes + " minutes is " + hours + " hour(s) or" + days " days");
}
}
6 0
3 years ago
Algorithm to find volume of cuboid​
Dovator [93]

Answer:

Volume of a Cuboid = Length * Breadth * Height.

Volume of a Cuboid = lbh.

The Lateral Surface Area of a Cuboid = 2h (l + w)

Explanation:

6 0
3 years ago
Other questions:
  • Using the bitwise AND operation, the result of 1 AND 0 is ___________. 10100100 ___________ 11010101 = 01110001. A common way to
    15·1 answer
  • Which of the following statements is true?
    14·1 answer
  • During flashbacks you experience______.
    14·2 answers
  • the command prompt window should be avoided because it is dangerous to do commands there? True or false
    14·1 answer
  • What term identifies the physical interface between a computer and its peripherals?
    5·1 answer
  • The code segment below is intended to randomly print one of the values 2, 4, 6, or 8 with equal probability.
    12·1 answer
  • Animation includes special visual and sound effects applied to text or other content. true or false.
    14·1 answer
  • When an Item is base lined, it becomes frozen, here frozenmeans that only creating an old version can change the item
    9·1 answer
  • Keely has an automation tool in place that runs a number of different processes for her and has for the last two years. All of a
    8·1 answer
  • A ________ implementation involves considerable modifications to the erp software
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!