Skip to main content

DataPrepKit is a Python class for data preparation and analysis. It provides functionalities for reading various data formats, summarizing statistics, handling missing values, and encoding categorical data.

Project description

DataPrepKit

DataPrepKit is a Python utility class for simplifying common data preparation tasks such as reading data from different file formats, generating summary statistics, handling missing values, and encoding categorical data.

Installation

You can install DataPrepKit using pip:

pip install dateprepkit

Usage

To use DataPrepKit in your Python project, follow the steps below:

from data_prep_kit import DataPrepKit
import pandas as pd

# Sample data
data = pd.read_csv('your_data.csv')

# Initialize DataPrepKit object
data_prep = DataPrepKit(data)
  1. Reading Data Use the read_data method to load data from various file formats such as CSV, Excel, or JSON:
# Read data from a CSV file
data = data_prep.read_data('your_data.csv', format='csv')
  1. Generating Data Summary Generate summary statistics for the loaded data using the data_summary method:
# Generate summary statistics
summary = data_prep.data_summary()
print(summary)
  1. Handling Missing Values Handle missing values in the DataFrame by either removing or imputing them using the handle_missing_values method:
# Handle missing values by removing rows with missing values
cleaned_data = data_prep.handle_missing_values(strategy='remove')
  1. Encoding Categorical Data Encode categorical columns in the DataFrame using one-hot encoding with the encode_categorical_data method:
# Encode categorical columns
encoded_data = data_prep.encode_categorical_data(categorical_columns=['category'])

Example

Here's a complete example of how to use DataPrepKit:

from data_prep_kit import DataPrepKit
import pandas as pd

# Sample data
data = pd.read_csv('your_data.csv')

# Initialize DataPrepKit object
data_prep = DataPrepKit(data)

# Read data from a CSV file
data = data_prep.read_data('your_data.csv', format='csv')

# Generate summary statistics
summary = data_prep.data_summary()
print(summary)

# Handle missing values by removing rows with missing values
cleaned_data = data_prep.handle_missing_values(strategy='remove')

# Encode categorical columns
encoded_data = data_prep.encode_categorical_data(categorical_columns=['category'])

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

dateprepkit-0.3.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dateprepkit-0.3-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file dateprepkit-0.3.tar.gz.

File metadata

  • Download URL: dateprepkit-0.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for dateprepkit-0.3.tar.gz
Algorithm Hash digest
SHA256 81973b7c986dabeec60fbfdfa7a84ce85f26250688b4d71d915d27cd2da6c6ab
MD5 b669f31503d8659a77f3ece6b56b2991
BLAKE2b-256 b275c954ab61af829b49c32d6a42a9a4b8127a2cc2e98deae2723d3543f1a247

See more details on using hashes here.

File details

Details for the file dateprepkit-0.3-py3-none-any.whl.

File metadata

  • Download URL: dateprepkit-0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for dateprepkit-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2074542b9cb36ead9ca5c76f3d507b741bbf4c4e02ad3ad1a8371600efd83427
MD5 8d9ae0b65ec9dcdf0644b18281c644d9
BLAKE2b-256 5b82393e367440a6cb96de939153ef1f28ecb92f6b49d0826bfd5216e51f4a8d

See more details on using hashes here.

Supported by

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