Pandas DataFrame to dict with crosstab DataFrames
$pip install a-pandas-ex-crosstab-dict
from a_pandas_ex_crosstab_dict import pd_add_crosstab_dict
import pandas as pd
pd_add_crosstab_dict()
df = pd.read_csv(
"https://raw.githubusercontent.com/pandas-dev/pandas/main/doc/data/titanic.csv"
)
df.ds_get_crosstab_dict(maincolumn="Cabin", columns=None)
df.ds_get_crosstab_dict( maincolumn="Cabin", columns=["Survived", "Sex",'Fare'])
Out[5]:
{'Survived': Cabin A10 A14 A16 A19 A20 A23 A24 ... F G73 F2 F33 F38 F4 G6 T
Survived ...
0 1 1 0 1 0 0 1 ... 2 1 0 1 0 2 1
1 0 0 1 0 1 1 0 ... 0 2 3 0 2 2 0
[2 rows x 147 columns],
'Sex': Cabin A10 A14 A16 A19 A20 A23 A24 ... F G73 F2 F33 F38 F4 G6 T
Sex ...
female 0 0 1 0 0 0 0 ... 0 0 3 0 1 4 0
male 1 1 0 1 1 1 1 ... 2 3 0 1 1 0 1
[2 rows x 147 columns],
'Fare': Cabin A10 A14 A16 A19 A20 A23 A24 ... F G73 F2 F33 F38 F4 G6 T
Fare ...
0.0000 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0
5.0000 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0
7.6500 0 0 0 0 0 0 0 ... 2 0 0 0 0 0 0
7.7500 0 0 0 0 0 0 0 ... 0 0 0 1 0 0 0
Metadata
Release files for a-pandas-ex-crosstab-dict 0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| a_pandas_ex_crosstab_dict-0.10.tar.gz | 3.6 kB | Without provenance | Details for a_pandas_ex_crosstab_dict-0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| a_pandas_ex_crosstab_dict-0.10-py3-none-any.whl | Python 3 | none | any | Details for a_pandas_ex_crosstab_dict-0.10-py3-none-any.whl |
Total release size: 8.8 kB
Release files / a_pandas_ex_crosstab_dict-0.10.tar.gz
| Download URL | a_pandas_ex_crosstab_dict-0.10.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77e688a72df6119be5524c253886dc15f46bf7426a42529841222667f59b59f9
|
|
BLAKE2b-256 checksum How to use checksums |
6c860114b754bf4d5eda74a1ddaff3b722c389c1c66a860a261fa445ca199b34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / a_pandas_ex_crosstab_dict-0.10-py3-none-any.whl
| Download URL | a_pandas_ex_crosstab_dict-0.10-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7eefc74d5806f72f57ba26df5f4a317b2f8a7ecd19d6bbba31c4aef2761b3d54
|
|
BLAKE2b-256 checksum How to use checksums |
cc0e1c7ba6acb20a7c60d4d40bffb6d1c57b591c5e1e721e61581afa8f7073fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for a-pandas-ex-crosstab-dict 0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.