0
0
Data Analysis Pythondata~30 mins

Basic DataFrame info (shape, dtypes, describe) in Data Analysis Python - Mini Project: Build & Apply

Choose your learning style9 modes available
Basic DataFrame info (shape, dtypes, describe)
📖 Scenario: You work in a small store and have a list of products with their prices and quantities. You want to organize this data in a table to learn more about it.
🎯 Goal: Create a DataFrame with product data, then find out its size, data types of each column, and some basic statistics.
📋 What You'll Learn
Create a pandas DataFrame with given product data
Create a variable to hold the DataFrame shape
Create a variable to hold the DataFrame data types
Create a variable to hold the DataFrame descriptive statistics
Print the shape, data types, and descriptive statistics
💡 Why This Matters
🌍 Real World
Stores and businesses often keep product data in tables and need to quickly understand the data size, types, and summary statistics to make decisions.
💼 Career
Data analysts and scientists use these basic DataFrame methods daily to explore and clean data before deeper analysis.
Progress0 / 4 steps
1
Create the product DataFrame
Import pandas as pd and create a DataFrame called df with these exact data: products 'Apple', 'Banana', 'Carrot', prices 0.5, 0.3, 0.2, and quantities 30, 45, 50.
Data Analysis Python
Need a hint?

Use pd.DataFrame() with a dictionary where keys are column names and values are lists of data.

2
Get the DataFrame shape
Create a variable called shape and set it to the shape of the DataFrame df using the shape attribute.
Data Analysis Python
Need a hint?

Use df.shape to get the number of rows and columns as a tuple.

3
Get the DataFrame data types
Create a variable called dtypes and set it to the data types of each column in df using the dtypes attribute.
Data Analysis Python
Need a hint?

Use df.dtypes to see the type of data in each column.

4
Get descriptive statistics and print all info
Create a variable called description and set it to the result of df.describe(). Then print shape, dtypes, and description each on its own line.
Data Analysis Python
Need a hint?

Use df.describe() to get statistics like mean and min. Use print() to show the results.