Skip to main content

Converts the output of some inspect functions to a DataFrame

Project description

Converts the output of some inspect functions to a DataFrame

pip install a-pandas-ex-inspect2df

    Convert the attributes of an object into a pandas DataFrame with information about each attribute.

    Args:
        obj: An object to inspect.

    Returns:
        A pandas DataFrame with the following columns:
            - aa_attrb_name: The name of the attribute.
            - aa_signature: The signature of the attribute.
            - aa_attrb: The attribute itself.
            - aa_doc: The docstring of the attribute.
            - aa_annotations: The annotations of the attribute.
            - aa_absfile: The absolute path of the file containing the attribute.
            - aa_closurevars: The closure variables of the attribute.
            - aa_unwrapped: The unwrapped attribute.

    Raises:
        None.
from a_pandas_ex_inspect2df import inspect2df
import pandas as pd
print(inspect2df(pd)[:25].to_string(max_colwidth=30))
       aa_attrb_name                   aa_signature                       aa_attrb                         aa_doc                 aa_annotations                     aa_absfile aa_closurevars                   aa_unwrapped
0         ArrowDtype  (pyarrow_dtype: 'pa.DataTy...  <class 'pandas.core.arrays...  An ExtensionDtype for PyAr...                             {}  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.arrays...
1       BooleanDtype                             ()  <class 'pandas.core.arrays...  Extension dtype for boolea...                             {}  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.arrays...
2        Categorical  (values, categories=None, ...  <class 'pandas.core.arrays...  Represent a categorical va...  {'_dtype': 'CategoricalDty...  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.arrays...
3   CategoricalDtype  (categories=None, ordered:...  <class 'pandas.core.dtypes...  Type for categorical data ...  {'type': 'type[Categorical...  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.dtypes...
4   CategoricalIndex  (data=None, categories=Non...  <class 'pandas.core.indexe...  Index based on an underlyi...  {'codes': 'np.ndarray', 'c...  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.indexe...
5          DataFrame  (data=None, index: 'Axes |...  <class 'pandas.core.frame....  Two-dimensional, size-muta...  {'_accessors': 'set[str]',...  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.frame....
6         DateOffset                           <NA>  <class 'pandas._libs.tslib...  Standard kind of date incr...                             {}  c:\programdata\anaconda3\e...           <NA>  <class 'pandas._libs.tslib...
7      DatetimeIndex  (data=None, freq: 'Frequen...  <class 'pandas.core.indexe...  Immutable ndarray-like of ...  {'_data': 'DatetimeArray',...  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.indexe...
8    DatetimeTZDtype  (unit: 'str_type | Datetim...  <class 'pandas.core.dtypes...  An ExtensionDtype for time...  {'type': 'type[Timestamp]'...  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.dtypes...
9          ExcelFile  (path_or_buffer, engine: '...  <class 'pandas.io.excel._b...  Class for parsing tabular ...  {'_engines': 'Mapping[str,...  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.io.excel._b...
10       ExcelWriter  (path: 'FilePath | WriteEx...  <class 'pandas.io.excel._b...  Class for writing DataFram...  {'_engine': 'str', '_suppo...  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.io.excel._b...
11             Flags  (obj, *, allows_duplicate_...  <class 'pandas.core.flags....  Flags that apply to pandas...                             {}  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.flags....
12      Float32Dtype                             ()  <class 'pandas.core.arrays...  An ExtensionDtype for floa...                             {}  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.arrays...
13      Float64Dtype                             ()  <class 'pandas.core.arrays...  An ExtensionDtype for floa...                             {}  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.arrays...
14           Grouper              (*args, **kwargs)  <class 'pandas.core.groupb...  A Grouper allows the user ...  {'sort': 'bool', 'dropna':...  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.groupb...
15          HDFStore  (path, mode: 'str' = 'a', ...  <class 'pandas.io.pytables...  Dict-like IO interface for...  {'_handle': 'File | None',...  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.io.pytables...
16             Index  (data=None, dtype=None, co...  <class 'pandas.core.indexe...  Immutable sequence used fo...  {'_typ': 'str', '_data': '...  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.indexe...
17        IndexSlice                           <NA>  <pandas.core.indexing._Ind...  Create an object to more e...                           <NA>                           <NA>           <NA>  <pandas.core.indexing._Ind...
18        Int16Dtype                             ()  <class 'pandas.core.arrays...  An ExtensionDtype for int1...                             {}  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.arrays...
19        Int32Dtype                             ()  <class 'pandas.core.arrays...  An ExtensionDtype for int3...                             {}  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.arrays...
20        Int64Dtype                             ()  <class 'pandas.core.arrays...  An ExtensionDtype for int6...                             {}  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.arrays...
21         Int8Dtype                             ()  <class 'pandas.core.arrays...  An ExtensionDtype for int8...                             {}  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.arrays...
22          Interval                           <NA>  <class 'pandas._libs.inter...  Immutable object implement...                             {}  c:\programdata\anaconda3\e...           <NA>  <class 'pandas._libs.inter...
23     IntervalDtype  (subtype=None, closed: 'st...  <class 'pandas.core.dtypes...  An ExtensionDtype for Inte...  {'kind': 'str_type', '_cac...  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.dtypes...
24     IntervalIndex  (data, closed=None, dtype:...  <class 'pandas.core.indexe...  Immutable index of interva...  {'closed': 'IntervalClosed...  c:\programdata\anaconda3\e...           <NA>  <class 'pandas.core.indexe...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a_pandas_ex_inspect2df-0.10.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

a_pandas_ex_inspect2df-0.10-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file a_pandas_ex_inspect2df-0.10.tar.gz.

File metadata

  • Download URL: a_pandas_ex_inspect2df-0.10.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for a_pandas_ex_inspect2df-0.10.tar.gz
Algorithm Hash digest
SHA256 542bd16edcd4b3d98cbc16de05325a7f0bbfadc405b2a0ed23905cf54abe52b0
MD5 e5411fa8061e26b1bcffc54eb3b5a3ed
BLAKE2b-256 29df56edb4f014d1093e4c072e1e89cdcc95b2c01bbdef6c7b1f321a9134c7d7

See more details on using hashes here.

File details

Details for the file a_pandas_ex_inspect2df-0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for a_pandas_ex_inspect2df-0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 44e2263f08f4998d57be0704df51ef7787ad3800de25d72592dc83d652b1c871
MD5 6830e5fc426effeeb5eab094046872d2
BLAKE2b-256 a94cdfc7c2a9fe09c5fa2947f0569c2af5e532609ba1008d64c529eb1af7091b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page