Question
How will you create an empty DataFrame in Pandas?

Answer

Create an empty DataFrame:

The below code shows how to create an empty DataFrame in Pandas:

# importing the pandas library

import pandas as pd

info = pd.DataFrame()

print (info)

Output:

Empty DataFrame

Columns: []

Index: []

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free

Similar questions

Write a program to read the records from laps.csv.
Consider the following table Student & Stream.

Table: Student

Admno Sname Class Sec Fee Mobile Area S_ID
1001 RAMESH XII A 2500 987654321 Madipur 10
1078 KRISHNA XII B 2400 999911111 Jawala Heri 30
1006 FARDEEN XII C 2600 987654321 Paschim Puri 40
1004 SUBHAM XII A 2500 963025874 Madipur 20
1029 KRITIKA XI C 2700 987456210 Madipur 30
1008 SAMEEKSHA XII A 2450 987123456 Mangol Puri 20
1025 SALMA XII B 2580 998877445 Madipur 30
1036 AMANDEEP XII B 2600 999333555 Khyala 40
1037 TEJAS XI C 2650 987951357 Paschim Puri 40
1029 HIMANSHU XII A 2750 951369874 Jawala Heri 10

Table : Stream

S_ID Stream_name
10 MEDILCAL
20 NON MEDICAL
30 COMMERCE WITH MATH
40 COMMERCE WITH IP
50 HUMANITIES

Write SQL commands for the statements (a) to (h) on the above table: Student and Stream
(a) Identify Primary Keys and Foreign Key in the table student and primary key in Stream table given above.
(b) Display stream id and stream-wise total fee collected.
(c) Count no of students from each area.
(d) Display all the student details those who belongs to Madipur Area.
(e) Increase the fees of all students by10%.
(f) Display unique area from the student table.
(g) Display details of those students whose area contains ‘Puri’.
(h) Display the information of those students who are in class XII and section is either B or C.

Write a menu driven program to calculate the total surface area and volume of a cube, cuboid, or sphere depending upon user's choice. The program should continue until the user selects the option to exit the program.
What is the basic difference between Trojan Horse and Computer Worm? 
Give two examples of PAN and LAN type of networks. 
What is the difference between Circuit Switching and Packet Switching Technique?
Define plagiarism.
Write a method in Python to read lines from a text file MYNOTES.TXT, and display those lines, which are starting with the alphabet ―K.
Write a script to create a list of 10 integers and then display the elements present at odd indices of the list.
Write a python script to read a number from the user and print the Fibonacci series up to that number.