dhmin.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:dhmin 作者: tum-ens 项目源码 文件源码
def read_excel(filename):
    """Read input Excel file and return dict of DataFrames for each sheet.

    Read an Excel spreadsheet with geographic input data.

    Args:
        filename: filename to an Excel spreadsheet with 'Vertex' and 'Edge'

    Returns:
        dict of 2 pandas DataFrames
    """
    with pd.ExcelFile(filename) as xls:
        vertex = xls.parse('Vertex').set_index('Vertex')
        edge = xls.parse('Edge').set_index(['Edge', 'Vertex1', 'Vertex2'])
    data = {
        'Vertex': vertex,
        'Edge': edge}
    return data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号