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
Alex Ar [27]
3 years ago
6

python Create a new qualitative variable, called Elite, by binning the Top10perc variable. We are going to divide universities i

nto two groups based on whether or not the proportion of students coming from the top 10% of their high school classes exceeds 50.
Computers and Technology
1 answer:
Studentka2010 [4]3 years ago
7 0

Answer:

import pandas as pd

# URL for university excel sheet( CSV format)

data_url = '' "

# Load the data from University URL

university = pd.read_csv(data_url)

# filter the data to contain universities from where more than 50 students out of the top 10% of their high school classes came

university_1 = university[universty.number>50 ]

n= len(university_1)

n1= (10 *n)/100

university_1.nlargest(n1, 'number')

print(university_1)

Explanation:

We are using here Pandas. And it is meant for reading from various data sources like Excel, Acess, SQL Server, etc. And first, we filter University with student number more than or equal to 50. Finally, with the nlargest, we find the top 10% of the list. And for running the above program we only need to add the URL of the university.csv. Nothing else is required. You can have the local file address as well if the CSV is on your computer.

You might be interested in
What is occurring when an attacker manipulates commonplace actions that are routinely performed in a business?
serg [7]

Answer:

Vulnerable business processes, also called business process compromise (BPC), occurs when an attacker manipulates commonplace actions that are routinely performed.

4 0
3 years ago
Write a program that receives a series of numbers from the user and allows the user to press the enter key to indicate that he o
Dmitriy789 [7]

Answer:

The solution code is written in Python 3

  1. count = 0
  2. sum = 0
  3. num = input("Enter a number: ")
  4. while(num != ''):
  5.    sum += float(num)
  6.    count += 1
  7.    num = input("Enter a number: ")
  8. print("Sum : " + str(sum))
  9. print("Average: " + str(sum / count))

Explanation:

Firstly, we declare two variables count and sum to hold the number of input number and the total of the input number, respectively (Line 1-2)

Next, we prompt user to input the first number (Line 4). While the num is not ' ' (This means it is not "Enter" key), accumulate the num to sum variable and increment count by one (Line 6-8) and then prompt the user to input the next number (Line 9).

At the end, display the sum and average using print function (Line 11 -12).

5 0
4 years ago
A critical piece of equipment that provides power to systems even during a black out is called a(n) _______________.
storchak [24]

Answer:C) Uninterruptible power supply

Explanation:Uninterruptible power supply(UPS) is the device that is used when the input source of power does not work or fails and thus it acts as a power supply in the emergency situation.This electronic devices in the protection of the hardware components of computer system etc.

Other option are incorrect because power strips, surge protector and password generator are no the devices that work during the power black out situation.Thus, the correct option is option(C).

7 0
3 years ago
You can clear a log file simply by redirecting nothing into it. true or false?
nekit [7.7K]
True

cat /dev/null > fileName


------------------------------------
6 0
4 years ago
Create and integrate a script on the registration.html page that stores the input field data into hidden fields to be used in th
Pavel [41]

Answer:

Explanation:

// CAPTURE QUERY STRING VALUES

var urlParams = new URLSearchParams(location.search);

var uid = urlParams.get('userName');

var fName = urlParams.get('firstName');

var lName = urlParams.get('lastName');

var pass = urlParams.get('password');

var email = urlParams.get('email');

var phone = urlParams.get('phoneNumber');

var signUp = urlParams.get('signUpNewsletter');

=====================================

Modified the checkbox control into multiple control

<div>

<select id="interests" name="interests" multiple>

<option value="Technology">Technology</option>

<option value="Music">Music</option>

<option value="Movies">Movies</option>

</select>

</div>

==================================

Added a js function to read multiple input values

function getSelectValues(select) {

var result = [];

var options = select && select.options;

var opt;

for (var i=0, iLen=options.length; i<iLen; i++) {

opt = options[i];

if (opt.selected) {

result.push(opt.value || opt.text);

}

}

return result;

}

==============================

Below is how I create cookie object

ar data =

{

uid:document.myForm.userName.value,

fName: document.myForm.firstName.value,

lName: document.myForm.lastName.value,

pass: document.myForm.password.value,

email: document.myForm.email.value,

phone:document.myForm.phoneNumber.value,

signUp: document.myForm.signUpNewsletter.value,

interests: getSelectValues(document.myForm.interests).toString(),

comment: document.myForm.comment.value,

referredBy: document.myForm.referredBy.value,

};

var dataString = "uid=" + data.uid + ",fName=" + data.fName + ",lName=" + data.lName + ",pass=" + data.pass + ""+ +",email=" + data.email + ",phone=" + data.phone + ",signUp=" + data.signUp + ",interests=" + data.interests + "" + +",comment=" + data.comment + ",referredBy=" + data.referredBy + "";

===========

Make sure you write last line in single line

3 0
3 years ago
Other questions:
  • An operating system cannot run from an external drive. true or false
    15·1 answer
  • What are the two main advantages to a well-designed relational database over other types?
    10·1 answer
  • 1) which colour filter is used to pumps up black and white effects?
    13·1 answer
  • How are blogs and wiki alike
    15·2 answers
  • How do you make Thumbnails and outros on Youtube for free?
    8·1 answer
  • What do customers use to access the internet, usually for a monthly fee?
    6·1 answer
  • Monica needs to work on a document where she has to highlight topics in bold and add emphasis to some words in a paragraph using
    9·1 answer
  • Como se diseña y produce un material audiovisual
    5·1 answer
  • Use the drop down menu to complete the sentences about changing and customizing the calendar view in outlook 2016​
    10·2 answers
  • During the data transmission there are chances that the data bits in the frame might get corrupted. This will require the sender
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!