top of page
Search

Pandas Part 3

Different Ways Of Creating Data Frame


By using Dictionaries of List


Example 1

** While creating data frame using dictionaries key will behave as columns and values will behave as column values


By using List of tuple


Example 2

** While creating data frame using list of tuple each tuple will behave as a row .When we convert it by using Data Frame Constructor pass columns arguments to pass the column names


By using List of Dictionaries


Example 3

**While creating data frame using list of dictionaries each dictionary will behave as a row where dictionary keys will behave as columns and values as values to corresponding key value


By using List of List


Example 4

** each inner list represents one row with each column values


By using Dictionary Of Pandas Data Structures


Example 5

** The dictionary keys represent the columns names and each Series represents a column contents


From csv(comma separated value) files


Example 6


** we can convert a csv file into data frame object by using read_csv() function

in read_csv() function you have to provide the path of the csv file


From xlsx files


Example 6

** we can convert a xlsx file into data frame object by using read_excel() function

in read_excel() function you have to provide the path of the xlsx file and also we can get that data from different sheet

56 views0 comments

Related Posts

תגובות


bottom of page