DataGen-kuma
DataGen-kuma is a library for generating test data.
It creates similar data with the same schema based on a Pandas DataFrame.
How It Works
DataGen-kuma takes a DataFrame as input and generates random test data.
Internally, it generates statistical metrics for each data type to facilitate data generation.
Using these metrics, it produces similar data appropriate for each data type.
Data Classification and Generation
- Numeric: Numeric data. Generates random values using Kernel Density Estimation (KDE) technique. The kernel density function uses gaussian_kde from scipy.stats.
- Category: Categorical data. Measures the frequency of each value and generates values according to these frequencies.
- Datetime: Date data following the ISO-8601 standard. Converts to Pandas Timestamps and generates random values within the given date range.
- Boolean: Boolean data. Measures the frequency of each value and generates values according to these frequencies.
- ETC: All other data types not mentioned above. Generates data by randomly sampling from the given values with replacement.
Usage
Assuming you have a Pandas DataFrame named df.
This example generates 100,000 rows of data.
The generated object allows access to each row through iteration.
from datagen_kuma.datagen import DataGen
datagen = DataGen(df=df, count=100_000)
for idx, row in datagen:
print(idx, row)
To retrieve the generated DataFrame, use the following:
generated_df = datagen.dataframe
Metadata
Release files for datagen-kuma 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| datagen_kuma-0.0.2.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datagen_kuma-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / datagen_kuma-0.0.2.tar.gz
| Download URL | datagen_kuma-0.0.2.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96cf0aaea116c61ce5a6f3329c3b5a291910136e349621203e71c4871bab3814
|
|
BLAKE2b-256 checksum How to use checksums |
1f186d551ddea2e71777257344307f44dde27873326f2c8f5d7d4131ab62b22f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.11
|
Release files / datagen_kuma-0.0.2-py3-none-any.whl
| Download URL | datagen_kuma-0.0.2-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eae1fa6d0126b09085d616ef2a54e49a9357a6fa889f55bf61d9b7cedd4abe04
|
|
BLAKE2b-256 checksum How to use checksums |
7b2b99c39acfe200e5d0a5b0b440e2f1adb39bcbaf101eaedc7f10b966fe7755
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.11
|