eaglelandsonce commited on
Commit
da5d510
1 Parent(s): 9346fae

Update pages/2_PandasIntro.py

Browse files
Files changed (1) hide show
  1. pages/2_PandasIntro.py +5 -4
pages/2_PandasIntro.py CHANGED
@@ -3,9 +3,10 @@ import pandas as pd
3
 
4
  # Example functions with explanations
5
  def example1():
6
- explanation = "Importing the Pandas library."
7
- code = "import pandas as pd"
8
- return explanation, code, None
 
9
 
10
  def example2():
11
  explanation = "Creating a simple DataFrame."
@@ -128,7 +129,7 @@ def example20():
128
  return explanation, code, df.sort_values(by='A')
129
 
130
  examples = [
131
- ("Example 1: Import Pandas", example1),
132
  ("Example 2: Create a simple DataFrame", example2),
133
  ("Example 3: Read a CSV file", example3),
134
  ("Example 4: Display the first few rows of a DataFrame", example4),
 
3
 
4
  # Example functions with explanations
5
  def example1():
6
+ explanation = "Creating a DataFrame from a dictionary."
7
+ code = "df = pd.DataFrame({'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [25, 30, 35]})\ndf"
8
+ df = pd.DataFrame({'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [25, 30, 35]})
9
+ return explanation, code, df
10
 
11
  def example2():
12
  explanation = "Creating a simple DataFrame."
 
129
  return explanation, code, df.sort_values(by='A')
130
 
131
  examples = [
132
+ ("Example 1: Creating a DataFrame from a dictionary", example1),
133
  ("Example 2: Create a simple DataFrame", example2),
134
  ("Example 3: Read a CSV file", example3),
135
  ("Example 4: Display the first few rows of a DataFrame", example4),