With the help of Pandas and Numpy library create a DataFrame with the columns "Name", "Surname", "Age" and "Gender", create as many rows as you want. Print out the result.

import pandas as pdimport numpy as npdf = pd.DataFrame(np.array([["John", "Smith", 23, "Male"], ["Emily", "Adams", 19, "Female"]]), columns=['Name', 'Surname', 'Age', 'Gender'])print(df)

LR
Answered by Lucia R. Python tutor

1942 Views

See similar Python Mentoring tutors

Related Python Mentoring answers

All answers ▸

Which function is ran when an object is instantiated?


Whats the output of "for i in "hello world": print(i)" and why/how is this achieved


Write a Python script to take a product name as input and then automatically google search reviews for it and open the top 3 search results in different tabs


Create an algorithm that can be used as a guessing game. Make sure to import random at the start.


We're here to help

contact us iconContact ustelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

MyTutor is part of the IXL family of brands:

© 2026 by IXL Learning