Answers for "create pandas"

2

create a df in pandas

import pandas as pd

data = {'First Column Name':  ['First value', 'Second value',...],
        'Second Column Name': ['First value', 'Second value',...],
         ....
        }

df = pd.DataFrame (data, columns = ['First Column Name','Second Column Name',...])
print (df)
Posted by: Guest on January-13-2021
0

pandas make new dataframe

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

Python Answers by Framework

Browse Popular Code Answers by Language