Question
Using Jupyter Notebook and Python, Numpy, Pandas, sqlite3 as db: import numpy as np import pandas as pd from pandas import DataFrame, Series import sqlite3
Using Jupyter Notebook and Python, Numpy, Pandas, sqlite3 as db:
import numpy as np
import pandas as pd
from pandas import DataFrame, Series import sqlite3 as dbmight help :
from pandasql import sqldf
Read the following data set:
https://archive.ics.uci.edu/ml/machine-learning-databases/adult/ Rename the columns as per the description from this file: https://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.names Task: Create a sql db from adult dataset and name it sqladb 1. Select 10 records from the adult sqladb 2. Show me the average hours per week of all men who are working in private sector 3. Show me the frequency table for education, occupation and relationship, separately 4. Are there any people who are married, working in private sector and having a masters degree 5. What is the average, minimum and maximum age group for people working in different sectors 6. Calculate age distribution by country 7. Compute a new column as 'Net-Capital-Gain' from the two columns 'capital-gain' and 'capital-loss'
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started