df5 = df4.rename(columns={'col1':'test1'})           # rename a column 
df6 = df5.rename(index={'A':'Alpha'})                # rename an index
dflist = df['col2'].tolist()                         # convert a column to a list
df6.index = df6.index.map(str.lower)                 # bulk convert all indexes to lower case
df7 = df6.rename(index=str.title, 
                 columns=str.title)                  # bulk convert indexes and columns to capital first letter
df > 0                                               # conditional operators create new, boolean dataframes
df.isnull()                                          # check entire dataframe for NaNs


#############################################################################################################
# 3. Sorting Dataframes
#############################################################################################################
df.sort_index()                                      # sort descending by index
df.sort(columns = ['Col1','Col2'],
        ascending = True, inplace = True)            # sort by specified column

#############################################################################################################
# 4. Missing Values
#############################################################################################################

df5 = DataFrame([[1,2,3,np.nan],[np.nan,5,6,7],[7,np.nan,9,np.nan],[np.nan,np.nan,np.nan,np.nan]])

df5.isnull()                                         # outputs a boolean dataframe
df6 = df5.dropna()                                   # .dropna() default drops a row if it finds even one NA
df7 = df5.dropna(how = 'all')                        # .dropna() will only dorp row if all obs are NA
df8 = df5.dropna(axis = 1, thresh = 2)               # to scan across columns; thresh = min count of NA's before deleting
df9 = df5.fillna(value = 0, axis = 1)                # .fillna() scans columns for NAs, replaces them with 0           
df10 = df5.fillna({0:0,1:1,2:2,3:3})                 # use a dictionary to fill diff values for diff columns
df5.fillna('NA', inplace= True )                     # use inplace=True for permanent processing