xorbits.pandas.read_clipboard#

xorbits.pandas.read_clipboard(sep: str = '\\s+', dtype_backend: DtypeBackend | lib.NoDefault = _NoDefault.no_default, **kwargs)[source]#

Read text from clipboard and pass to read_csv().

Parses clipboard contents similar to how CSV files are parsed using read_csv().

Parameters
  • sep (str, default '\s+') – A string or regex delimiter. The default of '\\s+' denotes one or more whitespace characters.

  • dtype_backend ({'numpy_nullable', 'pyarrow'}, default 'numpy_nullable') –

    Back-end data type applied to the resultant DataFrame (still experimental). Behaviour is as follows:

    • "numpy_nullable": returns nullable-dtype-backed DataFrame (default).

    • "pyarrow": returns pyarrow-backed nullable ArrowDtype DataFrame.

    New in version 2.0(pandas).

  • **kwargs – See read_csv() for the full argument list.

Returns

A parsed DataFrame object.

Return type

DataFrame

See also

DataFrame.to_clipboard

Copy object to the system clipboard.

read_csv

Read a comma-separated values (csv) file into DataFrame.

read_fwf

Read a table of fixed-width formatted lines into DataFrame.

Examples

>>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=['A', 'B', 'C'])  
>>> df.to_clipboard()  
>>> pd.read_clipboard()  
     A  B  C
0    1  2  3
1    4  5  6

Warning

This method has not been implemented yet. Xorbits will try to execute it with pandas.

This docstring was copied from pandas.