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.2.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.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dateprepkit-0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 730fa8aa28e220c8575ba71fd8f7b6d0108a33d471fb90c341dc53e4bdd81119
MD5 b33e1faf40cdf13d7859666ae765ce87
BLAKE2b-256 742e53da4e5dafeda329c4622da2ee6d2f34d30dfaf20907798e51b90f867f0e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dateprepkit-0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 00c5da494582b118a7aa527ba27ecad499614c1545d074a7207dbac505df95f0
MD5 7e0d49b2f83c180410a4e0112e608307
BLAKE2b-256 2f726a8e860e63b780d744e056ad4722246d3ec613cf1b43177c926b2976c8a3

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