Posts

Showing posts with the label Data Frame

Pandas - DataFrame

Image
Data Frames In my previous blog , I talked about using the Series Data Structure in Pandas. Feel free to have a  look at that blog. This blog post will be a brief walkthrough of Data Frames. Data Frame is one of the most widely used tool in python by Data Scientists/Analyst. A DataFrame can be considered as a data table. Data Frame provides a wide range of functionality like filtering grouping sorting joins merging Let's start with creating a data frame In [7]: #importing pandas and DataFrame import pandas as pd from pandas import DataFrame #constructor to create a data frame #df=DataFrame( data, index, columns, dtype, copy) #Lists, dict, Series, Numpy ndarrays, Another DataFrame #creating an empty data frame df = DataFrame () #creating a data frame form an array df = DataFrame ([ 1 , 2 , 3 , 4 , 5 , 5 ]) print df 0 0 1 1 2 2 3 3 4 4 5 5 5 In [8]: #