Answers for "how to build a dataframe in pandas"

1

how do we create a dataframe in python

# Import pandas library 
import pandas as pd 
  
# initialize list of lists 
data = [['Group A', 85], ['Group B', 92], ['Group C', 88]] 
  
# Create the pandas DataFrame 
df = pd.DataFrame(data, columns = ['Name', 'Score']) 
  
# print dataframe. 
df
Posted by: Guest on January-30-2021
0

pandas make new dataframe

df = pd.DataFrame({'column1':[1,2,3],'column2':[4,5,6])
Posted by: Guest on April-06-2021

Code answers related to "how to build a dataframe in pandas"

Python Answers by Framework

Browse Popular Code Answers by Language