> For the complete documentation index, see [llms.txt](https://danfo.jsdata.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://danfo.jsdata.org/api-reference/dataframe.md).

# Dataframe

### Attributes

| [`DataFrame.index`](/api-reference/dataframe/dataframe.index.md)          | The index (row labels) of the DataFrame. |
| ------------------------------------------------------------------------- | ---------------------------------------- |
| [`DataFrame.columns`](/api-reference/dataframe/danfo.dataframe.column.md) | The column labels of the DataFrame.      |

| [`DataFrame.ctypes`](/api-reference/dataframe/dataframe.dtypes.md)                                                               |   |
| -------------------------------------------------------------------------------------------------------------------------------- | - |
| [`DataFrame.values`](/api-reference/dataframe/dataframe.values.md)                                                               |   |
| [`DataFrame.axis`](/api-reference/dataframe/dataframe.axes.md)                                                                   |   |
| [`DataFrame.ndim`](/api-reference/dataframe/dataframe.ndim.md)                                                                   |   |
| [`DataFrame.size`](https://github.com/javascriptdata/danfojs-doc/blob/master/api-reference/dataframe/broken-reference/README.md) |   |
| [`DataFrame.shape`](/api-reference/dataframe/dataframe.shape.md)                                                                 |   |

### Conversion

| [`DataFrame.asType`](/api-reference/dataframe/dataframe.astype.md)   | Cast a pandas object to a specified dtype `dtype`. |
| -------------------------------------------------------------------- | -------------------------------------------------- |
| [`DataFrame.copy`](/api-reference/dataframe/danfo.dataframe.copy.md) | Make a copy of this object’s indices and data.     |

### Indexing, iteration

| [`DataFrame.head`](/api-reference/dataframe/danfo.dataframe.head.md)   | Return the first n rows                                            |
| ---------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [`DataFrame.loc`](/api-reference/dataframe/danfo.dataframe.loc.md)     | Access a group of rows and columns by label(s) or a boolean array. |
| [`DataFrame.iloc`](/api-reference/dataframe/danfo.dataframe.iloc.md)   | Purely integer-location based indexing for selection by position.  |
| [`DataFrame.tail`](/api-reference/dataframe/danfo.dataframe.tail.md)   | Return the last n rows.                                            |
| [`DataFrame.query`](/api-reference/dataframe/danfo.dataframe.query.md) | Query the columns of a DataFrame with a boolean expression.        |

### Binary operator functions

| [`DataFrame.add`](/api-reference/dataframe/danfo.dataframe.add.md)                                                             | Get Addition of dataframe and other, element-wise (binary operator add).                |
| ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
| [`DataFrame.sub`](/api-reference/dataframe/danfo.dataframe.sub.md)                                                             | Get Subtraction of dataframe and other, element-wise (binary operator sub).             |
| [`DataFrame.mul`](/api-reference/dataframe/danfo.dataframe.mul.md)                                                             | Get Multiplication of dataframe and other, element-wise (binary operator mul).          |
| [`DataFrame.div`](/api-reference/dataframe/danfo.dataframe.div.md)                                                             | Get Floating division of dataframe and other, element-wise (binary operator truediv).   |
| [`DataFrame.mod`](/api-reference/dataframe/danfo.dataframe.mod.md)                                                             | Get Modulo of dataframe and other, element-wise (binary operator mod).                  |
| [`DataFrame.pow`](/api-reference/dataframe/danfo.dataframe.pow.md)                                                             | Get Exponential power of dataframe and other, element-wise (binary operator pow).       |
| [`DataFrame.lt`](https://github.com/javascriptdata/danfojs-doc/blob/master/api-reference/dataframe/broken-reference/README.md) | Get Less than of dataframe and other, element-wise (binary operator lt).                |
| [`DataFrame.gt`](/api-reference/dataframe/danfo.dataframe.gt.md)                                                               | Get Greater than of dataframe and other, element-wise (binary operator gt).             |
| [`DataFrame.le`](/api-reference/dataframe/danfo.dataframe.le.md)                                                               | Get Less than or equal to of dataframe and other, element-wise (binary operator le).    |
| [`DataFrame.ge`](https://github.com/javascriptdata/danfojs-doc/blob/master/api-reference/dataframe/broken-reference/README.md) | Get Greater than or equal to of dataframe and other, element-wise (binary operator ge). |
| [`DataFrame.ne`](/api-reference/dataframe/danfo.dataframe.ne.md)                                                               | Get Not equal to of dataframe and other, element-wise (binary operator ne).             |
| [`DataFrame.eq`](/api-reference/dataframe/danfo.dataframe.eq.md)                                                               | Get Equal to of dataframe and other, element-wise (binary operator eq).                 |

### Function application & GroupBy

| [`DataFrame.apply`](/api-reference/dataframe/danfo.dataframe.apply.md) | Apply a function along an axis of the DataFrame.          |
| ---------------------------------------------------------------------- | --------------------------------------------------------- |
| [`DataFrame.groupby`](/api-reference/groupby.md)                       | Group DataFrame using a mapper or by a Series of columns. |
| [`DataFrame.map`](/api-reference/series/series.map.md)                 | Map a function on Object along an axis to DataFrame       |

### Computations / descriptive stats

| [`DataFrame.abs`](/api-reference/dataframe/danfo.dataframe.abs.md)                                                                  | Return a Series/DataFrame with absolute numeric value of each element. |
| ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [`DataFrame.corr`](https://github.com/javascriptdata/danfojs-doc/blob/master/api-reference/dataframe/broken-reference/README.md)    | Compute pairwise correlation of columns, excluding NA/null values.     |
| [`DataFrame.count`](/api-reference/dataframe/danfo.dataframe.count.md)                                                              | Count non-NAN cells for each column or row.                            |
| [`DataFrame.cumMax`](/api-reference/dataframe/danfo.dataframe.cummax.md)                                                            | Return cumulative maximum over a DataFrame or Series axis.             |
| [`DataFrame.cumMin`](/api-reference/dataframe/danfo.dataframe.cummin.md)                                                            | Return cumulative minimum over a DataFrame or Series axis.             |
| [`DataFrame.cumProd`](/api-reference/dataframe/danfo.dataframe.cumprod.md)                                                          | Return cumulative product over a DataFrame or Series axis.             |
| [`DataFrame.cumSum`](/api-reference/dataframe/danfo.dataframe.cumsum.md)                                                            | Return cumulative sum over a DataFrame or Series axis.                 |
| [`DataFrame.describe`](/api-reference/dataframe/danfo.dataframe.describe.md)                                                        | Generate descriptive statistics.                                       |
| [`DataFrame.max`](/api-reference/dataframe/danfo.dataframe.max.md)                                                                  | Return the maximum of the values for the requested axis.               |
| [`DataFrame.mean`](/api-reference/dataframe/danfo.dataframe.mean.md)                                                                | Return the mean of the values for the requested axis.                  |
| [`DataFrame.median`](/api-reference/dataframe/danfo.dataframe.median.md)                                                            | Return the median of the values for the requested axis.                |
| [`DataFrame.min`](/api-reference/dataframe/danfo.dataframe.min.md)                                                                  | Return the minimum of the values for the requested axis.               |
| [`DataFrame.mode`](/api-reference/series/series.mode.md)                                                                            | Get the mode(s) of each element along the selected axis.               |
| [`DataFrame.round`](/api-reference/dataframe/danfo.dataframe.round.md)                                                              | Round a DataFrame to a variable number of decimal places.              |
| [`DataFrame.sum`](/api-reference/dataframe/danfo.dataframe.sum.md)                                                                  | Return the sum of the values for the requested axis.                   |
| [`DataFrame.std`](/api-reference/dataframe/danfo.dataframe.std.md)                                                                  | Return sample standard deviation over requested axis.                  |
| [`DataFrame.var`](/api-reference/dataframe/danfo.dataframe.var.md)                                                                  | Return unbiased variance over requested axis.                          |
| [`DataFrame.nUnique`](https://github.com/javascriptdata/danfojs-doc/blob/master/api-reference/dataframe/broken-reference/README.md) | Count distinct observations over requested axis.                       |

### Reindexing / selection / label manipulation

|                                                                             |                                                         |
| --------------------------------------------------------------------------- | ------------------------------------------------------- |
| [`DataFrame.drop`](/api-reference/dataframe/dataframe.drop.md)              | Drop specified labels from rows or columns.             |
| [`DataFrame.head`](/api-reference/dataframe/danfo.dataframe.head.md)        | Return the first n rows.                                |
| [`DataFrame.rename`](/api-reference/dataframe/dataframe.rename.md)          | Alter axes labels.                                      |
| [`DataFrame.resetIndex`](/api-reference/dataframe/dataframe.reset_index.md) | Reset the index of a DataFrame                          |
| [`DataFrame.sample`](/api-reference/dataframe/danfo.dataframe.sample.md)    | Return a random sample of items from an axis of object. |
| [`DataFrame.setIndex`](/api-reference/dataframe/dataframe.set_index.md)     | Set the DataFrame index using existing columns.         |
| [`DataFrame.tail`](/api-reference/dataframe/danfo.dataframe.tail.md)        | Return the last n rows.                                 |

### Missing data handling

|                                                                            |                                             |
| -------------------------------------------------------------------------- | ------------------------------------------- |
| [`DataFrame.dropNa`](/api-reference/dataframe/danfo.dataframe.dropna.md)   | Remove missing values.                      |
| [`DataFrame.fillNa`](/api-reference/dataframe/danfo.dataframe.fillna.md)   | Fill NaN values with specified values       |
| [`DataFrame.isNa`](/api-reference/dataframe/danfo.dataframe.isna.md)       | Detect missing values.                      |
| [`DataFrame.replace`](/api-reference/dataframe/danfo.dataframe.replace.md) | Replace values given in replace with value. |

### Sorting & transposing

|                                                                                                                        |                                       |
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| [`DataFrame.sortVlues`](/api-reference/dataframe/dataframe.sort_values.md)                                             | Sort by the values along either axis. |
| [`DataFrame.T`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.T.html#pandas.DataFrame.T) | Return transpose of DataFrame         |

### Combining / comparing / joining / merging

|                                                                                |                                                                     |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------- |
| [`DataFrame.addColumn`](/api-reference/dataframe/danfo.dataframe.addcolumn.md) | Add new columns to a DataFrame.                                     |
| [`DataFrame.concat`](/api-reference/general-functions/danfo.concat.md)         | Concatenate DataFrames together.                                    |
| [`DataFrame.merge`](/api-reference/general-functions/danfo.merge.md)           | Merge DataFrame or named Series objects with a database-style join. |

### Plotting

`Series.plot` is both a callable method and a namespace attribute for specific plotting methods of the form `Series.plot.<kind>`.

|                                                                      |                                                               |
| -------------------------------------------------------------------- | ------------------------------------------------------------- |
| [DataFrame.plot.bar](/api-reference/plotting/bar-charts.md)          | Vertical bar plot.                                            |
| [`DataFrame.plot.box`](/api-reference/plotting/box-plots.md)         | Make a box plot of the DataFrame columns.                     |
| [`DataFrame.plot.violin`](/api-reference/plotting/box-plots.md)      | Make a violin plot of the DataFrame columns.                  |
| [`DataFrame.plot.hist`](/api-reference/plotting/histograms.md)       | Draw one histogram of the DataFrame’s columns.                |
| [`DataFrame.plot.scatter`](/api-reference/plotting/scatter-plots.md) | Generate Kernel Density Estimate plot using Gaussian kernels. |
| [`DataFrame.plot.line`](/api-reference/plotting/line-charts.md)      | Plot Series or DataFrame as lines.                            |
| [`DataFrame.plot.pie`](/api-reference/plotting/pie-charts.md)        | Generate a pie plot.                                          |
| [`Timeseries Plots`](/api-reference/plotting/timeseries-plots.md)    | Time series plots                                             |
| [`Table`](/api-reference/plotting/tables.md)                         | Display Series as Interactive table in Div                    |

### Serialization / IO / conversion

|                                                                     |                                  |
| ------------------------------------------------------------------- | -------------------------------- |
| [`DataFrame.toCSV`](/api-reference/dataframe/dataframe.to_csv.md)   | Convert DataFrame to a CSV file. |
| [`DataFrame.toJSON`](/api-reference/dataframe/dataframe.to_json.md) | Convert the object to a JSON.    |
| ``[`DataFrame.toExcel`](../input-output/danfo.to\_excel.md)``       | Convert DataFrame to Excel file  |
