to_sql.html)
    * [ pandas.read_gbq ](pandas.read_gbq.html)
    * [ pandas.read_stata ](pandas.read_stata.html)
    * [ pandas.DataFrame.to_stata ](pandas.DataFrame.to_stata.html)
    * [ pandas.io.stata.StataReader.data_label ](pandas.io.stata.StataReader.data_label.html)
    * [ pandas.io.stata.StataReader.value_labels ](pandas.io.stata.StataReader.value_labels.html)
    * [ pandas.io.stata.StataReader.variable_labels ](pandas.io.stata.StataReader.variable_labels.html)
    * [ pandas.io.stata.StataWriter.write_file ](pandas.io.stata.StataWriter.write_file.html)
  * [ General functions ](../general_functions.html)
  * [ Series ](../series.html)
  * [ DataFrame ](../frame.html)
  * [ pandas arrays, scalars, and data types ](../arrays.html)
  * [ Index objects ](../indexing.html)
  * [ Date offsets ](../offset_frequency.html)
  * [ Window ](../window.html)
  * [ GroupBy ](../groupby.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ Input/output ](../io.html)
  * pandas.DataF... 

#  pandas.DataFrame.to_orc  #

DataFrame.  to_orc  (  _ path  =  None  _ , _ *  _ , _ engine  =  'pyarrow'  _
, _ index  =  None  _ , _ engine_kwargs  =  None  _ )  [ [source]
](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/frame.py#L3124-L3210) #

    

Write a DataFrame to the ORC format.

New in version 1.5.0.

Parameters  :

    

**path** str, file-like object or None, default None

    

If a string, it will be used as Root Directory path when writing a partitioned
dataset. By file-like object, we refer to objects with a write() method, such
as a file handle (e.g. via builtin open function). If path is None, a bytes
object is returned.

**engine** {âpyarrowâ}, default âpyarrowâ

    

ORC library to use.

**index** bool, optional

    

If ` True  ` , include the dataframeâs index(es) in the file output. If `
False  ` , they will not be written to the file. If ` None  ` , similar to `
infer  ` the dataframeâs index(es) will be saved. However, instead of being
saved as values, the RangeIndex will be stored as a range in the metadata so
it doesnât require much space and is faster. Other indexes will be included
as columns in the file output.

**engine_kwargs** dict[str, Any] or None, default None

    

Additional keyword arguments passed to [ ` pyarrow.orc.write_table()  `
](https://arrow.apache.org/docs/python/generated/pyarrow.orc.write_table.html#pyarrow.orc.write_table
"\(in Apache Arrow v15.0.2\)") .

Returns  :

    

bytes if no path argument is provided else None

    
Raises  :

    

NotImplementedError

    

Dtype of one or more columns is category, unsigned integers, interval, period
or sparse.

ValueError

    

engine is not pyarrow.

See also

[ ` read_orc  ` ](pandas.read_orc.html#pandas.read_orc "pandas.read_orc")

    

Read a ORC file.

[ ` DataFrame.to_parquet  `
](pandas.DataFrame.to_parquet.html#pandas.DataFrame.to_parquet
"pandas.DataFrame.to_parquet")

    

Write a parquet file.

[ ` DataFrame.to_csv  ` ](pandas.DataFrame.to_csv.html#pandas.DataFrame.to_csv
"pandas.DataFrame.to_csv")

    

Write a csv file.

[ ` DataFrame.to_sql  ` ](pandas.DataFrame.to_sql.html#pandas.DataFrame.to_sql
"pandas.DataFrame.to_sql")

    

Write to a sql table.

[ ` DataFrame.to_hdf  ` ](pandas.DataFrame.to_hdf.html#pandas.DataFrame.to_hdf
"pandas.DataFrame.to_hdf")

    

Write to hdf.

Notes

  * Before using this function you should read the [ user guide about ORC  ](../../user_guide/io.html#io-orc) and [ install optional dependencies  ](../../getting_started/install.html#install-warn-orc) . 

  * This function requires [ pyarrow ](https://arrow.apache.org/docs/python/) library. 

  * For supported dtypes please refer