"""Auto-generated MCP server from package 'pandas'.

Generated by auto-mcp.
Modules analyzed: 12
Methods exposed: 102 tools, 0 resources, 0 prompts
"""

from typing import Any, Union
from mcp.server.fastmcp import FastMCP

import pandas
import pandas.plotting
import pandas.testing

# Create MCP server
mcp = FastMCP(name="pandas-mcp-server")

# Tools

@mcp.tool(name="array")
def array(data: Any, dtype: Any = None, copy: Any = True):
    """Create an array."""
    return pandas.array(data=data, dtype=dtype, copy=copy)


@mcp.tool(name="bdate_range")
def bdate_range(start: Any = None, end: Any = None, periods: Any = None, freq: Any = 'B', tz: Any = None, normalize: Any = True, name: Any = None, weekmask: Any = None, holidays: Any = None, inclusive: Any = 'both', **kwargs: Any):
    """Return a fixed frequency DatetimeIndex with business day as the default."""
    return pandas.bdate_range(start=start, end=end, periods=periods, freq=freq, tz=tz, normalize=normalize, name=name, weekmask=weekmask, holidays=holidays, inclusive=inclusive, **kwargs)


@mcp.tool(name="concat")
def concat(objs: Any, axis: Any = 0, join: Any = 'outer', ignore_index: Any = False, keys: Any = None, levels: Any = None, names: Any = None, verify_integrity: Any = False, sort: Any = False, copy: Any = None):
    """Concatenate pandas objects along a particular axis."""
    return pandas.concat(objs=objs, axis=axis, join=join, ignore_index=ignore_index, keys=keys, levels=levels, names=names, verify_integrity=verify_integrity, sort=sort, copy=copy)


@mcp.tool(name="crosstab")
def crosstab(index: Any, columns: Any, values: Any = None, rownames: Any = None, colnames: Any = None, aggfunc: Any = None, margins: Any = False, margins_name: Any = 'All', dropna: Any = True, normalize: Any = False):
    """Compute a simple cross tabulation of two (or more) factors."""
    return pandas.crosstab(index=index, columns=columns, values=values, rownames=rownames, colnames=colnames, aggfunc=aggfunc, margins=margins, margins_name=margins_name, dropna=dropna, normalize=normalize)


@mcp.tool(name="cut")
def cut(x: Any, bins: Any, right: bool = True, labels: Any = None, retbins: bool = False, precision: int = 3, include_lowest: bool = False, duplicates: str = 'raise', ordered: bool = True):
    """Bin values into discrete intervals."""
    return pandas.cut(x=x, bins=bins, right=right, labels=labels, retbins=retbins, precision=precision, include_lowest=include_lowest, duplicates=duplicates, ordered=ordered)


@mcp.tool(name="date_range")
def date_range(start: Any = None, end: Any = None, periods: Any = None, freq: Any = None, tz: Any = None, normalize: Any = False, name: Any = None, inclusive: Any = 'both', unit: Any = None, **kwargs: Any):
    """Return a fixed frequency DatetimeIndex."""
    return pandas.date_range(start=start, end=end, periods=periods, freq=freq, tz=tz, normalize=normalize, name=name, inclusive=inclusive, unit=unit, **kwargs)


@mcp.tool(name="eval")
def eval(expr: Any, parser: Any = 'pandas', engine: Any = None, local_dict: Any = None, global_dict: Any = None, resolvers: Any = (), level: Any = 0, target: Any = None, inplace: Any = False):
    """Evaluate a Python expression as a string using various backends."""
    return pandas.eval(expr=expr, parser=parser, engine=engine, local_dict=local_dict, global_dict=global_dict, resolvers=resolvers, level=level, target=target, inplace=inplace)


@mcp.tool(name="factorize")
def factorize(values: Any, sort: Any = False, use_na_sentinel: Any = True, size_hint: Any = None):
    """Encode the object as an enumerated type or categorical variable."""
    return pandas.factorize(values=values, sort=sort, use_na_sentinel=use_na_sentinel, size_hint=size_hint)


@mcp.tool(name="from_dummies")
def from_dummies(data: Any, sep: None | str = None, default_category: Any = None):
    """Create a categorical ``DataFrame`` from a ``DataFrame`` of dummy variables."""
    return pandas.from_dummies(data=data, sep=sep, default_category=default_category)


@mcp.tool(name="get_dummies")
def get_dummies(data: Any, prefix: Any = None, prefix_sep: Any = '_', dummy_na: Any = False, columns: Any = None, sparse: Any = False, drop_first: Any = False, dtype: Any = None):
    """Convert categorical variable into dummy/indicator variables."""
    return pandas.get_dummies(data=data, prefix=prefix, prefix_sep=prefix_sep, dummy_na=dummy_na, columns=columns, sparse=sparse, drop_first=drop_first, dtype=dtype)


@mcp.tool(name="infer_freq")
def infer_freq(index: Any):
    """Infer the most likely frequency given the input index."""
    return pandas.infer_freq(index=index)


@mcp.tool(name="interval_range")
def interval_range(start: Any = None, end: Any = None, periods: Any = None, freq: Any = None, name: Any = None, closed: Any = 'right'):
    """Return a fixed frequency IntervalIndex."""
    return pandas.interval_range(start=start, end=end, periods=periods, freq=freq, name=name, closed=closed)


@mcp.tool(name="isna")
def isna(obj: Any):
    """Detect missing values for an array-like object."""
    return pandas.isna(obj=obj)


@mcp.tool(name="isna")
def isna(obj: Any):
    """Detect missing values for an array-like object."""
    return pandas.isna(obj=obj)


@mcp.tool(name="json_normalize")
def json_normalize(data: Any, record_path: Any = None, meta: Any = None, meta_prefix: Any = None, record_prefix: Any = None, errors: Any = 'raise', sep: Any = '.', max_level: Any = None):
    """Normalize semi-structured JSON data into a flat table."""
    return pandas.json_normalize(data=data, record_path=record_path, meta=meta, meta_prefix=meta_prefix, record_prefix=record_prefix, errors=errors, sep=sep, max_level=max_level)


@mcp.tool(name="lreshape")
def lreshape(data: Any, groups: Any, dropna: Any = True):
    """Reshape wide-format data to long."""
    return pandas.lreshape(data=data, groups=groups, dropna=dropna)


@mcp.tool(name="melt")
def melt(frame: Any, id_vars: Any = None, value_vars: Any = None, var_name: Any = None, value_name: Any = 'value', col_level: Any = None, ignore_index: Any = True):
    """Unpivot a DataFrame from wide to long format, optionally leaving identifiers set."""
    return pandas.melt(frame=frame, id_vars=id_vars, value_vars=value_vars, var_name=var_name, value_name=value_name, col_level=col_level, ignore_index=ignore_index)


@mcp.tool(name="merge")
def merge(left: Any, right: Any, how: Any = 'inner', on: Any = None, left_on: Any = None, right_on: Any = None, left_index: Any = False, right_index: Any = False, sort: Any = False, suffixes: Any = ('_x', '_y'), copy: Any = None, indicator: Any = False, validate: Any = None):
    """Merge DataFrame or named Series objects with a database-style join."""
    return pandas.merge(left=left, right=right, how=how, on=on, left_on=left_on, right_on=right_on, left_index=left_index, right_index=right_index, sort=sort, suffixes=suffixes, copy=copy, indicator=indicator, validate=validate)


@mcp.tool(name="merge_asof")
def merge_asof(left: Any, right: Any, on: Any = None, left_on: Any = None, right_on: Any = None, left_index: Any = False, right_index: Any = False, by: Any = None, left_by: Any = None, right_by: Any = None, suffixes: Any = ('_x', '_y'), tolerance: Any = None, allow_exact_matches: Any = True, direction: Any = 'backward'):
    """Perform a merge by key distance."""
    return pandas.merge_asof(left=left, right=right, on=on, left_on=left_on, right_on=right_on, left_index=left_index, right_index=right_index, by=by, left_by=left_by, right_by=right_by, suffixes=suffixes, tolerance=tolerance, allow_exact_matches=allow_exact_matches, direction=direction)


@mcp.tool(name="merge_ordered")
def merge_ordered(left: Any, right: Any, on: Any = None, left_on: Any = None, right_on: Any = None, left_by: Any = None, right_by: Any = None, fill_method: Any = None, suffixes: Any = ('_x', '_y'), how: Any = 'outer'):
    """Perform a merge for ordered data with optional filling/interpolation."""
    return pandas.merge_ordered(left=left, right=right, on=on, left_on=left_on, right_on=right_on, left_by=left_by, right_by=right_by, fill_method=fill_method, suffixes=suffixes, how=how)


@mcp.tool(name="notna")
def notna(obj: Any):
    """Detect non-missing values for an array-like object."""
    return pandas.notna(obj=obj)


@mcp.tool(name="notna")
def notna(obj: Any):
    """Detect non-missing values for an array-like object."""
    return pandas.notna(obj=obj)


@mcp.tool(name="period_range")
def period_range(start: Any = None, end: Any = None, periods: Any = None, freq: Any = None, name: Any = None):
    """Return a fixed frequency PeriodIndex."""
    return pandas.period_range(start=start, end=end, periods=periods, freq=freq, name=name)


@mcp.tool(name="pivot")
def pivot(data: Any, columns: Any, index: Any = None, values: Any = None):
    """Return reshaped DataFrame organized by given index / column values."""
    return pandas.pivot(data=data, columns=columns, index=index, values=values)


@mcp.tool(name="pivot_table")
def pivot_table(data: Any, values: Any = None, index: Any = None, columns: Any = None, aggfunc: Any = 'mean', fill_value: Any = None, margins: Any = False, dropna: Any = True, margins_name: Any = 'All', observed: Any = None, sort: Any = True):
    """Create a spreadsheet-style pivot table as a DataFrame."""
    return pandas.pivot_table(data=data, values=values, index=index, columns=columns, aggfunc=aggfunc, fill_value=fill_value, margins=margins, dropna=dropna, margins_name=margins_name, observed=observed, sort=sort)


@mcp.tool(name="qcut")
def qcut(x: Any, q: Any, labels: Any = None, retbins: bool = False, precision: int = 3, duplicates: str = 'raise'):
    """Quantile-based discretization function."""
    return pandas.qcut(x=x, q=q, labels=labels, retbins=retbins, precision=precision, duplicates=duplicates)


@mcp.tool(name="read_clipboard")
def read_clipboard(sep: Any = '\\s+', dtype_backend: Any = None, **kwargs: Any):
    """Read text from clipboard and pass to :func:`~pandas."""
    return pandas.read_clipboard(sep=sep, dtype_backend=dtype_backend, **kwargs)


@mcp.tool(name="read_csv")
def read_csv(filepath_or_buffer: Any, sep: Any = None, delimiter: Any = None, header: Any = 'infer', names: Any = None, index_col: Any = None, usecols: Any = None, dtype: Any = None, engine: Any = None, converters: Any = None, true_values: Any = None, false_values: Any = None, skipinitialspace: Any = False, skiprows: Any = None, skipfooter: Any = 0, nrows: Any = None, na_values: Any = None, keep_default_na: Any = True, na_filter: Any = True, verbose: Any = None, skip_blank_lines: Any = True, parse_dates: Any = None, infer_datetime_format: Any = None, keep_date_col: Any = None, date_parser: Any = None, date_format: Any = None, dayfirst: Any = False, cache_dates: Any = True, iterator: Any = False, chunksize: Any = None, compression: Any = 'infer', thousands: Any = None, decimal: Any = '.', lineterminator: Any = None, quotechar: Any = '"', quoting: Any = 0, doublequote: Any = True, escapechar: Any = None, comment: Any = None, encoding: Any = None, encoding_errors: Any = 'strict', dialect: Any = None, on_bad_lines: Any = 'error', delim_whitespace: Any = None, low_memory: Any = True, memory_map: Any = False, float_precision: Any = None, storage_options: Any = None, dtype_backend: Any = None):
    """Read a comma-separated values (csv) file into DataFrame."""
    return pandas.read_csv(filepath_or_buffer=filepath_or_buffer, sep=sep, delimiter=delimiter, header=header, names=names, index_col=index_col, usecols=usecols, dtype=dtype, engine=engine, converters=converters, true_values=true_values, false_values=false_values, skipinitialspace=skipinitialspace, skiprows=skiprows, skipfooter=skipfooter, nrows=nrows, na_values=na_values, keep_default_na=keep_default_na, na_filter=na_filter, verbose=verbose, skip_blank_lines=skip_blank_lines, parse_dates=parse_dates, infer_datetime_format=infer_datetime_format, keep_date_col=keep_date_col, date_parser=date_parser, date_format=date_format, dayfirst=dayfirst, cache_dates=cache_dates, iterator=iterator, chunksize=chunksize, compression=compression, thousands=thousands, decimal=decimal, lineterminator=lineterminator, quotechar=quotechar, quoting=quoting, doublequote=doublequote, escapechar=escapechar, comment=comment, encoding=encoding, encoding_errors=encoding_errors, dialect=dialect, on_bad_lines=on_bad_lines, delim_whitespace=delim_whitespace, low_memory=low_memory, memory_map=memory_map, float_precision=float_precision, storage_options=storage_options, dtype_backend=dtype_backend)


@mcp.tool(name="read_excel")
def read_excel(io: Any, sheet_name: Any = 0, header: Any = 0, names: Any = None, index_col: Any = None, usecols: Any = None, dtype: Any = None, engine: Any = None, converters: Any = None, true_values: Any = None, false_values: Any = None, skiprows: Any = None, nrows: Any = None, na_values: Any = None, keep_default_na: Any = True, na_filter: Any = True, verbose: Any = False, parse_dates: Any = False, date_parser: Any = None, date_format: Any = None, thousands: Any = None, decimal: Any = '.', comment: Any = None, skipfooter: Any = 0, storage_options: Any = None, dtype_backend: Any = None, engine_kwargs: Any = None):
    """Read an Excel file into a ``pandas`` ``DataFrame``."""
    return pandas.read_excel(io=io, sheet_name=sheet_name, header=header, names=names, index_col=index_col, usecols=usecols, dtype=dtype, engine=engine, converters=converters, true_values=true_values, false_values=false_values, skiprows=skiprows, nrows=nrows, na_values=na_values, keep_default_na=keep_default_na, na_filter=na_filter, verbose=verbose, parse_dates=parse_dates, date_parser=date_parser, date_format=date_format, thousands=thousands, decimal=decimal, comment=comment, skipfooter=skipfooter, storage_options=storage_options, dtype_backend=dtype_backend, engine_kwargs=engine_kwargs)


@mcp.tool(name="read_feather")
def read_feather(path: Any, columns: Any = None, use_threads: Any = True, storage_options: Any = None, dtype_backend: Any = None):
    """Load a feather-format object from the file path."""
    return pandas.read_feather(path=path, columns=columns, use_threads=use_threads, storage_options=storage_options, dtype_backend=dtype_backend)


@mcp.tool(name="read_fwf")
def read_fwf(filepath_or_buffer: Any, colspecs: Any = 'infer', widths: Any = None, infer_nrows: Any = 100, dtype_backend: Any = None, iterator: Any = False, chunksize: Any = None, **kwargs: Any):
    """Read a table of fixed-width formatted lines into DataFrame."""
    return pandas.read_fwf(filepath_or_buffer=filepath_or_buffer, colspecs=colspecs, widths=widths, infer_nrows=infer_nrows, dtype_backend=dtype_backend, iterator=iterator, chunksize=chunksize, **kwargs)


@mcp.tool(name="read_gbq")
def read_gbq(query: Any, project_id: Any = None, index_col: Any = None, col_order: Any = None, reauth: Any = False, auth_local_webserver: Any = True, dialect: Any = None, location: Any = None, configuration: Any = None, credentials: Any = None, use_bqstorage_api: Any = None, max_results: Any = None, progress_bar_type: Any = None):
    """Load data from Google BigQuery."""
    return pandas.read_gbq(query=query, project_id=project_id, index_col=index_col, col_order=col_order, reauth=reauth, auth_local_webserver=auth_local_webserver, dialect=dialect, location=location, configuration=configuration, credentials=credentials, use_bqstorage_api=use_bqstorage_api, max_results=max_results, progress_bar_type=progress_bar_type)


@mcp.tool(name="read_hdf")
def read_hdf(path_or_buf: Any, key: Any = None, mode: Any = 'r', errors: Any = 'strict', where: Any = None, start: Any = None, stop: Any = None, columns: Any = None, iterator: Any = False, chunksize: Any = None, **kwargs: Any):
    """Read from the store, close it if we opened it."""
    return pandas.read_hdf(path_or_buf=path_or_buf, key=key, mode=mode, errors=errors, where=where, start=start, stop=stop, columns=columns, iterator=iterator, chunksize=chunksize, **kwargs)


@mcp.tool(name="read_html")
def read_html(io: Any, match: Any = '.+', flavor: Any = None, header: Any = None, index_col: Any = None, skiprows: Any = None, attrs: Any = None, parse_dates: Any = False, thousands: Any = ',', encoding: Any = None, decimal: Any = '.', converters: Any = None, na_values: Any = None, keep_default_na: Any = True, displayed_only: Any = True, extract_links: Any = None, dtype_backend: Any = None, storage_options: Any = None):
    """Read HTML tables into a ``list`` of ``DataFrame`` objects."""
    return pandas.read_html(io=io, match=match, flavor=flavor, header=header, index_col=index_col, skiprows=skiprows, attrs=attrs, parse_dates=parse_dates, thousands=thousands, encoding=encoding, decimal=decimal, converters=converters, na_values=na_values, keep_default_na=keep_default_na, displayed_only=displayed_only, extract_links=extract_links, dtype_backend=dtype_backend, storage_options=storage_options)


@mcp.tool(name="read_json")
def read_json(path_or_buf: Any, orient: Any = None, typ: Any = 'frame', dtype: Any = None, convert_axes: Any = None, convert_dates: Any = True, keep_default_dates: Any = True, precise_float: Any = False, date_unit: Any = None, encoding: Any = None, encoding_errors: Any = 'strict', lines: Any = False, chunksize: Any = None, compression: Any = 'infer', nrows: Any = None, storage_options: Any = None, dtype_backend: Any = None, engine: Any = 'ujson'):
    """Convert a JSON string to pandas object."""
    return pandas.read_json(path_or_buf=path_or_buf, orient=orient, typ=typ, dtype=dtype, convert_axes=convert_axes, convert_dates=convert_dates, keep_default_dates=keep_default_dates, precise_float=precise_float, date_unit=date_unit, encoding=encoding, encoding_errors=encoding_errors, lines=lines, chunksize=chunksize, compression=compression, nrows=nrows, storage_options=storage_options, dtype_backend=dtype_backend, engine=engine)


@mcp.tool(name="read_orc")
def read_orc(path: Any, columns: Any = None, dtype_backend: Any = None, filesystem: Any = None, **kwargs: Any):
    """Load an ORC object from the file path, returning a DataFrame."""
    return pandas.read_orc(path=path, columns=columns, dtype_backend=dtype_backend, filesystem=filesystem, **kwargs)


@mcp.tool(name="read_parquet")
def read_parquet(path: Any, engine: Any = 'auto', columns: Any = None, storage_options: Any = None, use_nullable_dtypes: Any = None, dtype_backend: Any = None, filesystem: Any = None, filters: Any = None, **kwargs: Any):
    """Load a parquet object from the file path, returning a DataFrame."""
    return pandas.read_parquet(path=path, engine=engine, columns=columns, storage_options=storage_options, use_nullable_dtypes=use_nullable_dtypes, dtype_backend=dtype_backend, filesystem=filesystem, filters=filters, **kwargs)


@mcp.tool(name="read_pickle")
def read_pickle(filepath_or_buffer: Any, compression: Any = 'infer', storage_options: Any = None):
    """Load pickled pandas object (or any object) from file."""
    return pandas.read_pickle(filepath_or_buffer=filepath_or_buffer, compression=compression, storage_options=storage_options)


@mcp.tool(name="read_sas")
def read_sas(filepath_or_buffer: Any, format: Any = None, index: Any = None, encoding: Any = None, chunksize: Any = None, iterator: Any = False, compression: Any = 'infer'):
    """Read SAS files stored as either XPORT or SAS7BDAT format files."""
    return pandas.read_sas(filepath_or_buffer=filepath_or_buffer, format=format, index=index, encoding=encoding, chunksize=chunksize, iterator=iterator, compression=compression)


@mcp.tool(name="read_spss")
def read_spss(path: Any, usecols: Any = None, convert_categoricals: Any = True, dtype_backend: Any = None):
    """Load an SPSS file from the file path, returning a DataFrame."""
    return pandas.read_spss(path=path, usecols=usecols, convert_categoricals=convert_categoricals, dtype_backend=dtype_backend)


@mcp.tool(name="read_sql")
def read_sql(sql: Any, con: Any, index_col: Any = None, coerce_float: Any = True, params: Any = None, parse_dates: Any = None, columns: Any = None, chunksize: Any = None, dtype_backend: Any = None, dtype: Any = None):
    """Read SQL query or database table into a DataFrame."""
    return pandas.read_sql(sql=sql, con=con, index_col=index_col, coerce_float=coerce_float, params=params, parse_dates=parse_dates, columns=columns, chunksize=chunksize, dtype_backend=dtype_backend, dtype=dtype)


@mcp.tool(name="read_sql_query")
def read_sql_query(sql: Any, con: Any, index_col: Any = None, coerce_float: Any = True, params: Any = None, parse_dates: Any = None, chunksize: Any = None, dtype: Any = None, dtype_backend: Any = None):
    """Read SQL query into a DataFrame."""
    return pandas.read_sql_query(sql=sql, con=con, index_col=index_col, coerce_float=coerce_float, params=params, parse_dates=parse_dates, chunksize=chunksize, dtype=dtype, dtype_backend=dtype_backend)


@mcp.tool(name="read_sql_table")
def read_sql_table(table_name: Any, con: Any, schema: Any = None, index_col: Any = None, coerce_float: Any = True, parse_dates: Any = None, columns: Any = None, chunksize: Any = None, dtype_backend: Any = None):
    """Read SQL database table into a DataFrame."""
    return pandas.read_sql_table(table_name=table_name, con=con, schema=schema, index_col=index_col, coerce_float=coerce_float, parse_dates=parse_dates, columns=columns, chunksize=chunksize, dtype_backend=dtype_backend)


@mcp.tool(name="read_stata")
def read_stata(filepath_or_buffer: Any, convert_dates: Any = True, convert_categoricals: Any = True, index_col: Any = None, convert_missing: Any = False, preserve_dtypes: Any = True, columns: Any = None, order_categoricals: Any = True, chunksize: Any = None, iterator: Any = False, compression: Any = 'infer', storage_options: Any = None):
    """Read Stata file into DataFrame."""
    return pandas.read_stata(filepath_or_buffer=filepath_or_buffer, convert_dates=convert_dates, convert_categoricals=convert_categoricals, index_col=index_col, convert_missing=convert_missing, preserve_dtypes=preserve_dtypes, columns=columns, order_categoricals=order_categoricals, chunksize=chunksize, iterator=iterator, compression=compression, storage_options=storage_options)


@mcp.tool(name="read_table")
def read_table(filepath_or_buffer: Any, sep: Any = None, delimiter: Any = None, header: Any = 'infer', names: Any = None, index_col: Any = None, usecols: Any = None, dtype: Any = None, engine: Any = None, converters: Any = None, true_values: Any = None, false_values: Any = None, skipinitialspace: Any = False, skiprows: Any = None, skipfooter: Any = 0, nrows: Any = None, na_values: Any = None, keep_default_na: Any = True, na_filter: Any = True, verbose: Any = None, skip_blank_lines: Any = True, parse_dates: Any = False, infer_datetime_format: Any = None, keep_date_col: Any = None, date_parser: Any = None, date_format: Any = None, dayfirst: Any = False, cache_dates: Any = True, iterator: Any = False, chunksize: Any = None, compression: Any = 'infer', thousands: Any = None, decimal: Any = '.', lineterminator: Any = None, quotechar: Any = '"', quoting: Any = 0, doublequote: Any = True, escapechar: Any = None, comment: Any = None, encoding: Any = None, encoding_errors: Any = 'strict', dialect: Any = None, on_bad_lines: Any = 'error', delim_whitespace: Any = None, low_memory: Any = True, memory_map: Any = False, float_precision: Any = None, storage_options: Any = None, dtype_backend: Any = None):
    """Read general delimited file into DataFrame."""
    return pandas.read_table(filepath_or_buffer=filepath_or_buffer, sep=sep, delimiter=delimiter, header=header, names=names, index_col=index_col, usecols=usecols, dtype=dtype, engine=engine, converters=converters, true_values=true_values, false_values=false_values, skipinitialspace=skipinitialspace, skiprows=skiprows, skipfooter=skipfooter, nrows=nrows, na_values=na_values, keep_default_na=keep_default_na, na_filter=na_filter, verbose=verbose, skip_blank_lines=skip_blank_lines, parse_dates=parse_dates, infer_datetime_format=infer_datetime_format, keep_date_col=keep_date_col, date_parser=date_parser, date_format=date_format, dayfirst=dayfirst, cache_dates=cache_dates, iterator=iterator, chunksize=chunksize, compression=compression, thousands=thousands, decimal=decimal, lineterminator=lineterminator, quotechar=quotechar, quoting=quoting, doublequote=doublequote, escapechar=escapechar, comment=comment, encoding=encoding, encoding_errors=encoding_errors, dialect=dialect, on_bad_lines=on_bad_lines, delim_whitespace=delim_whitespace, low_memory=low_memory, memory_map=memory_map, float_precision=float_precision, storage_options=storage_options, dtype_backend=dtype_backend)


@mcp.tool(name="read_xml")
def read_xml(path_or_buffer: Any, xpath: Any = './*', namespaces: Any = None, elems_only: Any = False, attrs_only: Any = False, names: Any = None, dtype: Any = None, converters: Any = None, parse_dates: Any = None, encoding: Any = 'utf-8', parser: Any = 'lxml', stylesheet: Any = None, iterparse: Any = None, compression: Any = 'infer', storage_options: Any = None, dtype_backend: Any = None):
    """Read XML document into a :class:`~pandas."""
    return pandas.read_xml(path_or_buffer=path_or_buffer, xpath=xpath, namespaces=namespaces, elems_only=elems_only, attrs_only=attrs_only, names=names, dtype=dtype, converters=converters, parse_dates=parse_dates, encoding=encoding, parser=parser, stylesheet=stylesheet, iterparse=iterparse, compression=compression, storage_options=storage_options, dtype_backend=dtype_backend)


@mcp.tool(name="set_eng_float_format")
def set_eng_float_format(accuracy: int = 3, use_eng_prefix: bool = False):
    """Format float representation in DataFrame with SI notation."""
    return pandas.set_eng_float_format(accuracy=accuracy, use_eng_prefix=use_eng_prefix)


@mcp.tool(name="show_versions")
def show_versions(as_json: str | bool = False):
    """Provide useful information, important for bug reports."""
    return pandas.show_versions(as_json=as_json)


@mcp.tool(name="test")
def test(extra_args: list[str] | None = None, run_doctests: bool = False):
    """Run the pandas test suite using pytest."""
    return pandas.test(extra_args=extra_args, run_doctests=run_doctests)


@mcp.tool(name="timedelta_range")
def timedelta_range(start: Any = None, end: Any = None, periods: int | None = None, freq: Any = None, name: Any = None, closed: Any = None, unit: str | None = None):
    """Return a fixed frequency TimedeltaIndex with day as the default."""
    return pandas.timedelta_range(start=start, end=end, periods=periods, freq=freq, name=name, closed=closed, unit=unit)


@mcp.tool(name="to_datetime")
def to_datetime(arg: Any, errors: Any = 'raise', dayfirst: Any = False, yearfirst: Any = False, utc: Any = False, format: Any = None, exact: Any = None, unit: Any = None, infer_datetime_format: Any = None, origin: Any = 'unix', cache: Any = True):
    """Convert argument to datetime."""
    return pandas.to_datetime(arg=arg, errors=errors, dayfirst=dayfirst, yearfirst=yearfirst, utc=utc, format=format, exact=exact, unit=unit, infer_datetime_format=infer_datetime_format, origin=origin, cache=cache)


@mcp.tool(name="to_numeric")
def to_numeric(arg: Any, errors: Any = 'raise', downcast: Any = None, dtype_backend: Any = None):
    """Convert argument to a numeric type."""
    return pandas.to_numeric(arg=arg, errors=errors, downcast=downcast, dtype_backend=dtype_backend)


@mcp.tool(name="to_pickle")
def to_pickle(obj: Any, filepath_or_buffer: Any, compression: Any = 'infer', protocol: Any = 5, storage_options: Any = None):
    """Pickle (serialize) object to file."""
    return pandas.to_pickle(obj=obj, filepath_or_buffer=filepath_or_buffer, compression=compression, protocol=protocol, storage_options=storage_options)


@mcp.tool(name="to_timedelta")
def to_timedelta(arg: Any, unit: Any = None, errors: Any = 'raise'):
    """Convert argument to timedelta."""
    return pandas.to_timedelta(arg=arg, unit=unit, errors=errors)


@mcp.tool(name="unique")
def unique(values: Any):
    """Return unique values based on a hash table."""
    return pandas.unique(values=values)


@mcp.tool(name="value_counts")
def value_counts(values: Any, sort: Any = True, ascending: Any = False, normalize: Any = False, bins: Any = None, dropna: Any = True):
    """Compute a histogram of the counts of non-null values."""
    return pandas.value_counts(values=values, sort=sort, ascending=ascending, normalize=normalize, bins=bins, dropna=dropna)


@mcp.tool(name="wide_to_long")
def wide_to_long(df: Any, stubnames: Any, i: Any, j: Any, sep: Any = '', suffix: Any = '\\d+'):
    """Unpivot a DataFrame from wide to long format."""
    return pandas.wide_to_long(df=df, stubnames=stubnames, i=i, j=j, sep=sep, suffix=suffix)


@mcp.tool(name="isna")
def isna():
    """Detect missing values

Missing values (-1 in."""
    return pandas.Categorical.isna()


@mcp.tool(name="isna")
def isna():
    """Detect missing values

Missing values (-1 in."""
    return pandas.Categorical.isna()


@mcp.tool(name="notna")
def notna():
    """Inverse of isna

Both missing values (-1 in."""
    return pandas.Categorical.notna()


@mcp.tool(name="notna")
def notna():
    """Inverse of isna

Both missing values (-1 in."""
    return pandas.Categorical.notna()


@mcp.tool(name="unique")
def unique():
    """Return the ``Categorical`` which ``categories`` and ``codes`` are
unique."""
    return pandas.Categorical.unique()


@mcp.tool(name="value_counts")
def value_counts(dropna: Any = True):
    """Return a Series containing counts of each category."""
    return pandas.Categorical.value_counts(dropna=dropna)


@mcp.tool(name="eval")
def eval(expr: str, inplace: bool = False, **kwargs: Any):
    """Evaluate a string describing operations on DataFrame columns."""
    return pandas.DataFrame.eval(expr=expr, inplace=inplace, **kwargs)


@mcp.tool(name="isna")
def isna():
    """Detect missing values."""
    return pandas.DataFrame.isna()


@mcp.tool(name="isnull")
def isnull():
    """DataFrame."""
    return pandas.DataFrame.isnull()


@mcp.tool(name="melt")
def melt(id_vars: Any = None, value_vars: Any = None, var_name: Any = None, value_name: Any = 'value', col_level: Any = None, ignore_index: Any = True):
    """Unpivot a DataFrame from wide to long format, optionally leaving identifiers set."""
    return pandas.DataFrame.melt(id_vars=id_vars, value_vars=value_vars, var_name=var_name, value_name=value_name, col_level=col_level, ignore_index=ignore_index)


@mcp.tool(name="merge")
def merge(right: Any, how: Any = 'inner', on: Any = None, left_on: Any = None, right_on: Any = None, left_index: Any = False, right_index: Any = False, sort: Any = False, suffixes: Any = ('_x', '_y'), copy: Any = None, indicator: Any = False, validate: Any = None):
    """Merge DataFrame or named Series objects with a database-style join."""
    return pandas.DataFrame.merge(right=right, how=how, on=on, left_on=left_on, right_on=right_on, left_index=left_index, right_index=right_index, sort=sort, suffixes=suffixes, copy=copy, indicator=indicator, validate=validate)


@mcp.tool(name="notna")
def notna():
    """Detect existing (non-missing) values."""
    return pandas.DataFrame.notna()


@mcp.tool(name="notnull")
def notnull():
    """DataFrame."""
    return pandas.DataFrame.notnull()


@mcp.tool(name="pivot")
def pivot(columns: Any, index: Any = None, values: Any = None):
    """Return reshaped DataFrame organized by given index / column values."""
    return pandas.DataFrame.pivot(columns=columns, index=index, values=values)


@mcp.tool(name="pivot_table")
def pivot_table(values: Any = None, index: Any = None, columns: Any = None, aggfunc: Any = 'mean', fill_value: Any = None, margins: Any = False, dropna: Any = True, margins_name: Any = 'All', observed: Any = None, sort: Any = True):
    """Create a spreadsheet-style pivot table as a DataFrame."""
    return pandas.DataFrame.pivot_table(values=values, index=index, columns=columns, aggfunc=aggfunc, fill_value=fill_value, margins=margins, dropna=dropna, margins_name=margins_name, observed=observed, sort=sort)


@mcp.tool(name="value_counts")
def value_counts(subset: Any = None, normalize: Any = False, sort: Any = True, ascending: Any = False, dropna: Any = True):
    """Return a Series containing the frequency of each distinct row in the Dataframe."""
    return pandas.DataFrame.value_counts(subset=subset, normalize=normalize, sort=sort, ascending=ascending, dropna=dropna)


@mcp.tool(name="isna")
def isna():
    """Detect missing values."""
    return pandas.Index.isna()


@mcp.tool(name="isna")
def isna():
    """Detect missing values."""
    return pandas.Index.isna()


@mcp.tool(name="notna")
def notna():
    """Detect existing (non-missing) values."""
    return pandas.Index.notna()


@mcp.tool(name="notna")
def notna():
    """Detect existing (non-missing) values."""
    return pandas.Index.notna()


@mcp.tool(name="unique")
def unique(level: Any = None):
    """Return unique values in the index."""
    return pandas.Index.unique(level=level)


@mcp.tool(name="unique")
def unique(level: Any = None):
    """Return unique values in the index."""
    return pandas.MultiIndex.unique(level=level)


@mcp.tool(name="factorize")
def factorize(sort: Any = False, use_na_sentinel: Any = True):
    """Encode the object as an enumerated type or categorical variable."""
    return pandas.RangeIndex.factorize(sort=sort, use_na_sentinel=use_na_sentinel)


@mcp.tool(name="isna")
def isna():
    """Detect missing values."""
    return pandas.Series.isna()


@mcp.tool(name="isnull")
def isnull():
    """Series."""
    return pandas.Series.isnull()


@mcp.tool(name="notna")
def notna():
    """Detect existing (non-missing) values."""
    return pandas.Series.notna()


@mcp.tool(name="notnull")
def notnull():
    """Series."""
    return pandas.Series.notnull()


@mcp.tool(name="unique")
def unique():
    """Return unique values of Series object."""
    return pandas.Series.unique()


@mcp.tool(name="andrews_curves")
def andrews_curves(frame: Any, class_column: Any, ax: Any = None, samples: Any = 200, color: Any = None, colormap: Any = None, **kwargs: Any):
    """Generate a matplotlib plot for visualizing clusters of multivariate data."""
    return pandas.plotting.andrews_curves(frame=frame, class_column=class_column, ax=ax, samples=samples, color=color, colormap=colormap, **kwargs)


@mcp.tool(name="autocorrelation_plot")
def autocorrelation_plot(series: Any, ax: Any = None, **kwargs: Any):
    """Autocorrelation plot for time series."""
    return pandas.plotting.autocorrelation_plot(series=series, ax=ax, **kwargs)


@mcp.tool(name="bootstrap_plot")
def bootstrap_plot(series: Any, fig: Any = None, size: Any = 50, samples: Any = 500, **kwargs: Any):
    """Bootstrap plot on mean, median and mid-range statistics."""
    return pandas.plotting.bootstrap_plot(series=series, fig=fig, size=size, samples=samples, **kwargs)


@mcp.tool(name="boxplot")
def boxplot(data: Any, column: Any = None, by: Any = None, ax: Any = None, fontsize: Any = None, rot: Any = 0, grid: Any = True, figsize: Any = None, layout: Any = None, return_type: Any = None, **kwargs: Any):
    """Make a box plot from DataFrame columns."""
    return pandas.plotting.boxplot(data=data, column=column, by=by, ax=ax, fontsize=fontsize, rot=rot, grid=grid, figsize=figsize, layout=layout, return_type=return_type, **kwargs)


@mcp.tool(name="boxplot_frame")
def boxplot_frame(column: Any = None, by: Any = None, ax: Any = None, fontsize: Any = None, rot: Any = 0, grid: Any = True, figsize: Any = None, layout: Any = None, return_type: Any = None, backend: Any = None, **kwargs: Any):
    """Make a box plot from DataFrame columns."""
    return pandas.plotting.boxplot_frame(column=column, by=by, ax=ax, fontsize=fontsize, rot=rot, grid=grid, figsize=figsize, layout=layout, return_type=return_type, backend=backend, **kwargs)


@mcp.tool(name="boxplot_frame_groupby")
def boxplot_frame_groupby(grouped: Any, subplots: Any = True, column: Any = None, fontsize: Any = None, rot: Any = 0, grid: Any = True, ax: Any = None, figsize: Any = None, layout: Any = None, sharex: Any = False, sharey: Any = True, backend: Any = None, **kwargs: Any):
    """Make box plots from DataFrameGroupBy data."""
    return pandas.plotting.boxplot_frame_groupby(grouped=grouped, subplots=subplots, column=column, fontsize=fontsize, rot=rot, grid=grid, ax=ax, figsize=figsize, layout=layout, sharex=sharex, sharey=sharey, backend=backend, **kwargs)


@mcp.tool(name="hist_frame")
def hist_frame(data: Any, column: Any = None, by: Any = None, grid: Any = True, xlabelsize: Any = None, xrot: Any = None, ylabelsize: Any = None, yrot: Any = None, ax: Any = None, sharex: Any = False, sharey: Any = False, figsize: Any = None, layout: Any = None, bins: Any = 10, backend: Any = None, legend: Any = False, **kwargs: Any):
    """Make a histogram of the DataFrame's columns."""
    return pandas.plotting.hist_frame(data=data, column=column, by=by, grid=grid, xlabelsize=xlabelsize, xrot=xrot, ylabelsize=ylabelsize, yrot=yrot, ax=ax, sharex=sharex, sharey=sharey, figsize=figsize, layout=layout, bins=bins, backend=backend, legend=legend, **kwargs)


@mcp.tool(name="hist_series")
def hist_series(by: Any = None, ax: Any = None, grid: Any = True, xlabelsize: Any = None, xrot: Any = None, ylabelsize: Any = None, yrot: Any = None, figsize: Any = None, bins: Any = 10, backend: Any = None, legend: Any = False, **kwargs: Any):
    """Draw histogram of the input series using matplotlib."""
    return pandas.plotting.hist_series(by=by, ax=ax, grid=grid, xlabelsize=xlabelsize, xrot=xrot, ylabelsize=ylabelsize, yrot=yrot, figsize=figsize, bins=bins, backend=backend, legend=legend, **kwargs)


@mcp.tool(name="lag_plot")
def lag_plot(series: Any, lag: Any = 1, ax: Any = None, **kwargs: Any):
    """Lag plot for time series."""
    return pandas.plotting.lag_plot(series=series, lag=lag, ax=ax, **kwargs)


@mcp.tool(name="parallel_coordinates")
def parallel_coordinates(frame: Any, class_column: Any, cols: Any = None, ax: Any = None, color: Any = None, use_columns: Any = False, xticks: Any = None, colormap: Any = None, axvlines: Any = True, axvlines_kwds: Any = None, sort_labels: Any = False, **kwargs: Any):
    """Parallel coordinates plotting."""
    return pandas.plotting.parallel_coordinates(frame=frame, class_column=class_column, cols=cols, ax=ax, color=color, use_columns=use_columns, xticks=xticks, colormap=colormap, axvlines=axvlines, axvlines_kwds=axvlines_kwds, sort_labels=sort_labels, **kwargs)


@mcp.tool(name="radviz")
def radviz(frame: Any, class_column: Any, ax: Any = None, color: Any = None, colormap: Any = None, **kwargs: Any):
    """Plot a multidimensional dataset in 2D."""
    return pandas.plotting.radviz(frame=frame, class_column=class_column, ax=ax, color=color, colormap=colormap, **kwargs)


@mcp.tool(name="scatter_matrix")
def scatter_matrix(frame: Any, alpha: Any = 0.5, figsize: Any = None, ax: Any = None, grid: Any = False, diagonal: Any = 'hist', marker: Any = '.', density_kwds: Any = None, hist_kwds: Any = None, range_padding: Any = 0.05, **kwargs: Any):
    """Draw a matrix of scatter plots."""
    return pandas.plotting.scatter_matrix(frame=frame, alpha=alpha, figsize=figsize, ax=ax, grid=grid, diagonal=diagonal, marker=marker, density_kwds=density_kwds, hist_kwds=hist_kwds, range_padding=range_padding, **kwargs)


@mcp.tool(name="table")
def table(ax: Any, data: Any, **kwargs: Any):
    """Helper function to convert DataFrame and Series to matplotlib."""
    return pandas.plotting.table(ax=ax, data=data, **kwargs)


@mcp.tool(name="assert_extension_array_equal")
def assert_extension_array_equal(left: Any, right: Any, check_dtype: Any = True, index_values: Any = None, check_exact: Any = None, rtol: Any = None, atol: Any = None, obj: str = 'ExtensionArray'):
    """Check that left and right ExtensionArrays are equal."""
    return pandas.testing.assert_extension_array_equal(left=left, right=right, check_dtype=check_dtype, index_values=index_values, check_exact=check_exact, rtol=rtol, atol=atol, obj=obj)


@mcp.tool(name="assert_frame_equal")
def assert_frame_equal(left: Any, right: Any, check_dtype: Any = True, check_index_type: Any = 'equiv', check_column_type: Any = 'equiv', check_frame_type: bool = True, check_names: bool = True, by_blocks: bool = False, check_exact: Any = None, check_datetimelike_compat: bool = False, check_categorical: bool = True, check_like: bool = False, check_freq: bool = True, check_flags: bool = True, rtol: Any = None, atol: Any = None, obj: str = 'DataFrame'):
    """Check that left and right DataFrame are equal."""
    return pandas.testing.assert_frame_equal(left=left, right=right, check_dtype=check_dtype, check_index_type=check_index_type, check_column_type=check_column_type, check_frame_type=check_frame_type, check_names=check_names, by_blocks=by_blocks, check_exact=check_exact, check_datetimelike_compat=check_datetimelike_compat, check_categorical=check_categorical, check_like=check_like, check_freq=check_freq, check_flags=check_flags, rtol=rtol, atol=atol, obj=obj)


@mcp.tool(name="assert_index_equal")
def assert_index_equal(left: Any, right: Any, exact: bool | str = 'equiv', check_names: bool = True, check_exact: bool = True, check_categorical: bool = True, check_order: bool = True, rtol: float = 1e-05, atol: float = 1e-08, obj: str = 'Index'):
    """Check that left and right Index are equal."""
    return pandas.testing.assert_index_equal(left=left, right=right, exact=exact, check_names=check_names, check_exact=check_exact, check_categorical=check_categorical, check_order=check_order, rtol=rtol, atol=atol, obj=obj)


@mcp.tool(name="assert_series_equal")
def assert_series_equal(left: Any, right: Any, check_dtype: Any = True, check_index_type: Any = 'equiv', check_series_type: bool = True, check_names: bool = True, check_exact: Any = None, check_datetimelike_compat: bool = False, check_categorical: bool = True, check_category_order: bool = True, check_freq: bool = True, check_flags: bool = True, rtol: Any = None, atol: Any = None, obj: str = 'Series', check_index: bool = True, check_like: bool = False):
    """Check that left and right Series are equal."""
    return pandas.testing.assert_series_equal(left=left, right=right, check_dtype=check_dtype, check_index_type=check_index_type, check_series_type=check_series_type, check_names=check_names, check_exact=check_exact, check_datetimelike_compat=check_datetimelike_compat, check_categorical=check_categorical, check_category_order=check_category_order, check_freq=check_freq, check_flags=check_flags, rtol=rtol, atol=atol, obj=obj, check_index=check_index, check_like=check_like)




if __name__ == "__main__":
    mcp.run()
