Professional Documents
Culture Documents
03 - Introduction To Pandas 3
03 - Introduction To Pandas 3
This DataFrame is going to store the AdjVolume for each of IBM, Microsoft and Google.
You will use the pandas DataFrame() function to create the DataFrame and then add 3 new columns to it
with names 'IBM', Microsoft' and 'Google'.
You will use the data in the 'AdjVolume' columns from your previous DataFrames to populate your new
DataFrame.
df_Vol['IBM'] = df_IBM['Volume']
df_Vol['MSoft'] = df_MSFT['Volume']
df_Vol['Google'] = df_GOOGL['Volume']
df_Vol.head()
In addition, pandas supplies a useful function called describe() that prints out some summary information
about a DataFrame.
Finally, you can use the transpose() function on a DataFrame to flip the output around. Transposing a
DataFrame may or may not be useful depending on your personal preferences, size and shape of your data, etc.
In [ ]: df_Vol.shape
df_Vol.size
df_Vol.describe()
df_Vol.describe().transpose()
df_Vol.transpose()
Filtering Data
Filters in a DataFrame allow you to conditionally select data from a DataFrame
syntax is
df[expr]
e.g.