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)

Answered by Lucia R. Python tutor

1129 Views

See similar Python Mentoring tutors

Related Python Mentoring answers

All answers ▸

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


Explain the difference between local and global variables


Define a function that takes in the age of the user and adds it to an output sentence such as "You are ..... old".


What is the difference between a for loop and a while loop?


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2024

Terms & Conditions|Privacy Policy