<filename>Conversions/esri_object_2_pandasdf.py
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 28 15:58:07 2020

@author: dconly
"""

import pandas as pd
import arcpy

def esri_object_to_df(in_esri_obj, esri_obj_fields, index_field=None):
    '''converts esri gdb table, feature class, feature layer, or SHP to pandas dataframe'''
    data_rows = []
    with arcpy.da.SearchCursor(in_esri_obj, esri_obj_fields) as cur:
        for row in cur:
            out_row = list(row)
            data_rows.append(out_row)

    out_df = pd.DataFrame(data_rows, index=index_field, columns=esri_obj_fields)
    return out_df
<filename>Conversions/esri_object_2_pandasdf.py
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 28 15:58:07 2020

@author: dconly
"""

import pandas as pd
import arcpy

def esri_object_to_df(in_esri_obj, esri_obj_fields, index_field=None):
    '''converts esri gdb table, feature class, feature layer, or SHP to pandas dataframe'''
    data_rows = []
    with arcpy.da.SearchCursor(in_esri_obj, esri_obj_fields) as cur:
        for row in cur:
            out_row = list(row)
            data_rows.append(out_row)

    out_df = pd.DataFrame(data_rows, index=index_field, columns=esri_obj_fields)
    return out_df
# -*- coding: utf-8 -*- Created on Fri Aug 28 15:58:07 2020  @author: dconly converts esri gdb table, feature class, feature layer, or SHP to pandas dataframe