<commit_before>###########################
Python Package Introduction
###########################
This document gives a basic walkthrough of xgboost python package.

**List of other Helpful Links**

* `Python walkthrough code collections <https://github.com/tqchen/xgboost/blob/master/demo/guide-python>`_
* :doc:`Python API Reference <python_api>`

Install XGBoost
---------------
To install XGBoost, follow instructions in :doc:`/build`.

To verify your installation, run the following in Python:

.. code-block:: python

  import xgboost as xgb

.. _python_data_interface:

Data Interface
--------------
The XGBoost python module is able to load data from:

- LibSVM text format file
- Comma-separated values (CSV) file
- NumPy 2D array
- SciPy 2D sparse array
- Pandas data frame, and
- XGBoost binary buffer file.

(See :doc:`/tutorials/input_format` for detailed description of text input format.)

The data is stored in a :py:class:`DMatrix <xgboost.DMatrix>` object.

* To load a libsvm text file or a XGBoost binary file into :py:class:`DMatrix <xgboost.DMatrix>`:
<commit_msg>Add cuDF DataFrame to doc. (#5053)<commit_after>###########################
Python Package Introduction
###########################
This document gives a basic walkthrough of xgboost python package.

**List of other Helpful Links**

* `Python walkthrough code collections <https://github.com/tqchen/xgboost/blob/master/demo/guide-python>`_
* :doc:`Python API Reference <python_api>`

Install XGBoost
---------------
To install XGBoost, follow instructions in :doc:`/build`.

To verify your installation, run the following in Python:

.. code-block:: python

  import xgboost as xgb

.. _python_data_interface:

Data Interface
--------------
The XGBoost python module is able to load data from:

- LibSVM text format file
- Comma-separated values (CSV) file
- NumPy 2D array
- SciPy 2D sparse array
- cuDF DataFrame
- Pandas data frame, and
- XGBoost binary buffer file.

(See :doc:`/tutorials/input_format` for detailed description of text input format.)

The data is stored in a :py:class:`DMatrix <xgboost.DMatrix>` object.

* To load a libsvm text file or a XGBoost binary file into :py:class:`DMatrix <xgboost.DMatrix>`:

{'fraction_non_alphanumeric': 0.15687160940325498, 'fraction_numerical': 0.003616636528028933, 'mean_word_length': 4.158508158508159, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6689534', 'n_tokens_mistral': 691, 'n_tokens_neox': 654, 'n_words': 247}