Skip to content
check GPT output
import pandas as pd
import numpy as np
# Create list of names
names = ['Alice', 'Bob', 'Charlie', 'David', 'Emily']
# Generate random heights between 150 and 190 cm
heights = np.random.randint(150, 190, size=5)
# Generate random eye colors
eye_colors = np.random.choice(['brown', 'blue', 'green'], size=5)
# Create dataframe
data = {'name': names, 'height_cm': heights, 'eye_color': eye_colors}
df = pd.DataFrame(data)
print(df)
mean_height = df['height_cm'].mean()
print("Mean Height: {:.2f} cm".format(mean_height))