We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
VERY IMPORTANT EXERCISE FOR FINTECH PRACTICE
PRACTICE EXERCISES:
1. LOAD THE CSV FILE:
o Load the CARSALES.csv file into a pandas Data. o Display the first few rows of the Data to understand its structure. 2. DATA SUMMARY: o Provide a summary of the Data, including the number of rows, columns, and data types of each column. o Calculate basic statistics for all numerical columns. 3. FILTER DATA: o Filter the Data to show only the cars manufactured by 'Toyota'. o Filter the Data to show cars with an engine size greater than 3.0 liters. 4. GROUP AND AGGREGATE: o Group the data by 'Manufacturer' and calculate the average engine size for each manufacturer. o Group the data by 'Manufacturer' and 'Model', and calculate the total sales for each group. 5. FIND MAXIMUM AND MINIMUM VALUES: o Find the car with the maximum engine size. o Find the car with the minimum price. 6. SORT DATA: o Sort the Data by 'EngineSize' in descending order. o Sort the Data by 'Price' in ascending order. 7. ADD AND REMOVE COLUMNS: o Add a new column that calculates the price per horsepower for each car. o Remove any columns that have more than 50% missing values. 8. HANDLE MISSING DATA: o Identify columns with missing data. o Fill missing values in the 'Price' column with the median price. o Drop rows where the 'EngineSize' column has missing values. 9. PLOTTING DATA: o Create a histogram of the 'Price' column. o Create a scatter plot of 'EngineSize' vs. 'Price'. o Create a bar plot showing the average price for each manufacturer. VERY IMPORTANT EXERCISE FOR FINTECH PRACTICE
10. ADVANCED FILTERING AND AGGREGATION:
o Filter the Data to show only cars with a price between $20,000 and $40,000. o Group the data by 'Manufacturer' and calculate the total number of cars sold for each manufacturer. 11. STRING OPERATIONS: o Extract the year from a 'Date' column if it exists. o Convert the 'Manufacturer' column to lowercase. 12. MERGE AND JOIN DATAS: o Create a new Data with additional information about each manufacturer (e.g., country of origin) and merge it with the original Data. o Perform a left join and an inner join using the new Data. 13. SAVE AND EXPORT DATA: o Save the filtered Data to a new CSV file. o Export the summary statistics of the numerical columns to a CSV file. 14. DATETIME OPERATIONS: o Convert a 'LaunchDate' column to datetime format if it exists. o Calculate the number of days since the launch for each car. 15. ADVANCED GROUPING: o Group the data by 'Manufacturer' and calculate the average, minimum, and maximum price for each group. o Find the manufacturer with the highest average engine size.