Question

Out [21]: White White White Black o <=50K <=50K <=50K <=50K Black <=50K White <=50K Black White White <=50K >50K >50K White >here is the data and the code i wrote for get some informations. i need to extrat the information that it should be white in I column and >=50K in O column.   but my code is not working

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code:

Input:

I O
white <=50k
white <=50k
white <=50k
black <=50k
black <=50k
white <=50k
black <=50k
white <=50k
white <=50k
black <=50k
Asian pack isalander <=50k

import pandas as pd
data = pd.read_csv("data.csv")
print("Your Data :",data)
print("===================================")
df = data[data["I"] =="white"]
print("required Data :")
df

Output:

Your Data : I O 0 white <=50k 1 white <=50k 2 white <=50k 3 black <=50k 4 black <=50k 5 white <=50k 6 black <=50k 7 white <=50k 8 white <=50k 9 black <=50k 10 Asian pack isalander <=50k =================================== required Data : 

Out[5]:

I O
0 white <=50k
1 white <=50k
2 white <=50k
5 white <=50k
7 white <=50k
8 white <=50k
Add a comment
Know the answer?
Add Answer to:
here is the data and the code i wrote for get some informations. i need to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Must be written in basic C language. I keep getting stuck with my code. Step 1:...

    Must be written in basic C language. I keep getting stuck with my code. Step 1: You are to write an algorithm to compute e1 using the Taylor Series Expansion n! o Use the highest precision possible Step 2: Calculate the error between your algorithm and the value computed using the function exp(x) found in the <math.h> library. .Step 3: Calculate how many digits of precision is your algorithm.

  • C++: questions are in fish.h. Write the code in fish.cpp and main.cpp #ifndef FISH_H #define FISH_H...

    C++: questions are in fish.h. Write the code in fish.cpp and main.cpp #ifndef FISH_H #define FISH_H #include <vector> class Fish { public: // (1 point) // Write code to initialize edible to is_edible, age to 0, size to 1. Fish (bool is_edible); // (1 point) // Print the vital stats (size and age) of the fish. void Print(); // (1 point) // If fish is at least the age of reproduce_age, reproduce with probability // of reproduce_probability. If reproduce, return...

  • I have to write a loop that moves the content of the dynamic array to the...

    I have to write a loop that moves the content of the dynamic array to the static array but I can't seem to figure it out. Exit Full Screen code.cpp New 1 #include <iostream> 3 using namespace std; 4 5 int main) 6 int *ptr 7 ptr -new int[5]; 8 int arr[5]; 9int x; 10 cin >> x; 11 for( int í = 0; 1 < 5; 1++) // initialization 12 13 ptr[i] x; = 14 for O//your code goes...

  • Need help with this question! I need the working out too! Qia) The work done on...

    Need help with this question! I need the working out too! Qia) The work done on an object whose displacement vector is s =< 3, -4,0 > by a force f =< 3, -2,1 > is: a. 5+ V14 b. 17 c. None of the above. Qib) The cross product of a =< 1,2,3,4 > and b =< 4, -3, -2,2 > is: d. <4, -6, -6,8 > e. O f. None of the above. QIC) The position vector OP...

  • It's a MIPS question. Can anyone explain what's happened in the loop? Thank you. I need...

    It's a MIPS question. Can anyone explain what's happened in the loop? Thank you. I need a deep explanation. Ma1n SvO, 4 $a0, stri1 # print string upper case 14 syscall $v0, 4 $a0, string 16 # print string "ABCDEFG. 18 syscall v0, 4 $a0, str2 19 # print string lower case 21 syscall 23 1oo 24 25 26 $t1, string($tO) beq $t1, $zero, exit blt $t1, A', continue bgt $t1, 2', conti addi $t1, $t1, 0x20 sb #t0 to...

  • Below is the code created for a previous assignment. I now need to create functions to...

    Below is the code created for a previous assignment. I now need to create functions to validate the name, age, and item selection in an external JavaScript file. Specifically, check for the following: The user has entered a name Age is a number between 18 and 110 An item is selected Ensure that a handler returns true if the input is acceptable and false otherwise. Add an onSubmit attribute to the form tag so that a validation failure prevents the...

  • I NEED HELP FINDING THE BUG IN THIS CODE USING THE GDB #include #include <stdio.h> <string.h>...

    I NEED HELP FINDING THE BUG IN THIS CODE USING THE GDB #include #include <stdio.h> <string.h> Return the result of appending the characters in s2 to s1 Assumption: enough space has been allocated for sl to store the extra characters. char* append (char s1[ ], char s2[ ]) int sllenstrlen (s1); int s2lenstrlen (s2) int k; for (k=0; k<s21en; k++) { sl [kts11en] = s2 [k] ; return sl; int main () char strl [10]; char str2 [10]; while (1)...

  • I need this Program code made for Java please with the sample results. Echo Input from...

    I need this Program code made for Java please with the sample results. Echo Input from the Console to the Screen Using Methods Review the resources and instructions in the Discussion Prep Study before completing this discussion. For this discussion, you practiced using Java methods to echo input from the console to the screen. Create a Java program that reads in any value entered at the console and then prints it out to the screen. The program must have at...

  • C++ ONLY! Consider the following code and answer the questions in the table below. #include <iostream>...

    C++ ONLY! Consider the following code and answer the questions in the table below. #include <iostream> template <typename T, int N=10> class Array { private:   T array[N+1]; public:   Array() {     for(int i=0; i<N+1; i++) array[i] = 0;   }      T& operator [] (int index) {     if (index>N || index < 0)       return array[N];     else       return array[index];   }   template <typename S>   Array<T,N>& operator= (S &other) {     for(int i=0; i<N+1; i++)       array[i] = other[i];         return *this;   } }; template <typename T, typename...

  • I need help in this basic java programming. I just need a program that output this...

    I need help in this basic java programming. I just need a program that output this according to the original picture above. Quick Access 熅Package Explorer 23 曰ちい▽ーロ D Volunteer,java D Volunteer Test.java 23 -ロ 貝Task List 2 public class VolunteerTest ▼申(default package) Volunteer java 4 public static void main(String[] args) Find THIS CODE MUST NOT BE CHANGED IN ANY WAY!1 JRE System Library [JavaSE-18] // The code below will be used to test the Volunteer class I/ created by...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT