0 votes
in Python Pandas by
Define the different ways a DataFrame can be created in pandas?

1 Answer

0 votes
by
We can create a DataFrame using following ways:

Lists

Dict of ndarrays

Example-1: Create a DataFrame using List:

importpandas as pd

# a list of strings

a = [‘Python’, ‘Pandas’]

# Calling DataFrame constructor on list

info = pd.DataFrame(a)

print(info)

Related questions

0 votes
asked Nov 9, 2021 in Python Pandas by Robin
0 votes
asked Aug 14, 2021 in Python Pandas by SakshiSharma
...