• to_excel


    Signature:
    df.to_excel(
        ['excel_writer', "sheet_name='Sheet1'", "na_rep=''", 'float_format=None', 'columns=None', 'header=True', 'index=True', 'index_label=None', 'startrow=0', 'startcol=0', 'engine=None', 'merge_cells=True', 'encoding=None', "inf_rep='inf'", 'verbose=True', 'freeze_panes=None'],
    )
    Docstring:
    Write DataFrame to an excel sheet
    
    
    Parameters
    ----------
    excel_writer : string or ExcelWriter object
        File path or existing ExcelWriter
    sheet_name : string, default 'Sheet1'
        Name of sheet which will contain DataFrame
    na_rep : string, default ''
        Missing data representation
    float_format : string, default None
        Format string for floating point numbers
    columns : sequence, optional
        Columns to write
    header : boolean or list of string, default True
        Write out the column names. If a list of strings is given it is
        assumed to be aliases for the column names
    index : boolean, default True
        Write row names (index)
    index_label : string or sequence, default None
        Column label for index column(s) if desired. If None is given, and
        `header` and `index` are True, then the index names are used. A
        sequence should be given if the DataFrame uses MultiIndex.
    startrow :
        upper left cell row to dump data frame
    startcol :
        upper left cell column to dump data frame
    engine : string, default None
        write engine to use - you can also set this via the options
        ``io.excel.xlsx.writer``, ``io.excel.xls.writer``, and
        ``io.excel.xlsm.writer``.
    merge_cells : boolean, default True
        Write MultiIndex and Hierarchical Rows as merged cells.
    encoding: string, default None
        encoding of the resulting excel file. Only necessary for xlwt,
        other writers support unicode natively.
    inf_rep : string, default 'inf'
        Representation for infinity (there is no native representation for
        infinity in Excel)
    freeze_panes : tuple of integer (length 2), default None
        Specifies the one-based bottommost row and rightmost column that
        is to be frozen
    
        .. versionadded:: 0.20.0
    
    Notes
    -----
    If passing an existing ExcelWriter object, then the sheet will be added
    to the existing workbook.  This can be used to save different
    DataFrames to one workbook:
    
    >>> writer = pd.ExcelWriter('output.xlsx')
    >>> df1.to_excel(writer,'Sheet1')
    >>> df2.to_excel(writer,'Sheet2')
    >>> writer.save()
    
    For compatibility with to_csv, to_excel serializes lists and dicts to
    strings before writing.
    File:      c:userslenovoanaconda3libsite-packagespandascoreframe.py
    Type:      method
    

      

  • 相关阅读:
    JS字符串函数String.replace()[转]
    分辨率和比例尺[转]
    DateDiff 函数的用法 SQL时间比较
    ASP.NET 2.0 本地化2
    ASP.NET 2.0 本地化1
    简单的分页过程,确在第10,20,30....等页,不能显示,请求帮忙,谢谢
    JQuery打造的分页无刷新的Repeater
    让flash置于DIV层之下的方法,让flash不挡住飘浮层或下拉菜单
    VS2005 + VSS6.0 简单应用示例
    SQLServer查询最近一天,三天,一周,一月,一季度方法
  • 原文地址:https://www.cnblogs.com/wangtaobiu/p/12006457.html
Copyright © 2020-2023  润新知