Skip to main content

DataNerd

This package provides various functions for data analysis, statistical calculations, database operations, and sending notifications.

Installation

To use these functions, you need to have Python installed on your system. You also need to install the required libraries. You can install them using pip:

pip install pandas numpy sqlalchemy requests

Functions

1. stats()

This function provides statistical summary of a given dataframe.

Parameters:

  • df (pandas.DataFrame): The input dataframe

Returns:

  • A dataframe containing various statistics for each column

Statistics provided:

  • count
  • mean
  • std
  • min
  • 10th, 20th, 25th, 30th, 40th, 50th (median), 60th, 70th, 75th, 80th, 90th, 95th, 99th percentiles
  • max
  • % of missing values
  • number of unique values

Usage:

import pandas as pd
import datanerd as dn

df = pd.read_csv('titanic.csv')
summary_stats = dn.stats(df)

2. iv_woe()

This function calculates the Weight of Evidence (WoE) and Information Value (IV) for a given dataframe.

Parameters:

  • data (pandas.DataFrame): The input dataframe
  • target (str): The name of the target variable
  • bins (int): The number of bins to use for discretizing continuous variables
  • optimize (bool): Whether to optimize the binning of continuous variables
  • threshold (float): The minimum percentage of non-events in each bin for optimization

Returns:

  • A tuple containing two dataframes: (iv, woe)

Usage:

import pandas as pd
import datanerd as dn

df = pd.read_csv('cancer.csv')
iv, woe = dn.iv_woe(data=df, target='Diagnosis', bins=20, optimize=True, threshold=0.05)

3. pushdb()

This function pushes a Pandas dataframe to a Microsoft SQL Server database.

Parameters:

  • data (pandas.DataFrame): The dataframe to be pushed
  • tablename (str): The name of the table in the database
  • server (str): The name of the SQL Server
  • database (str): The name of the database
  • schema (str): The name of the schema

Usage:

import pandas as pd
import datanerd as dn

df = pd.read_csv('day.csv')
dn.pushdb(df, tablename='day', server='SQL', database='schedule', schema='analysis')

4. teams_webhook()

This function sends a formatted message to a Microsoft Teams channel using a webhook URL.

Parameters:

  • webhook_url (str): The webhook URL for the Teams channel
  • title (str): The title of the message
  • message (str): The body of the message

Usage:

import datanerd as dn

webhook_url = "https://outlook.office.com/webhook/..."
title = "Important Notification"
message = "This is a test message sent from Python!"

dn.teams_webhook(webhook_url, title, message)

5. ntfy()

This function sends a notification message to an ntfy.sh server.

Parameters:

  • server (str): The name of the ntfy.sh server/topic to send the message to
  • message (str): The message to be sent

Usage:

import datanerd as dn

server = "your_server_name"
message = "This is a test notification from Python!"

dn.ntfy(server, message)

Metadata

Release files for datanerd 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datanerd 1.2
File Size Uploaded Provenance
datanerd-1.2.tar.gz 5.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for datanerd 1.2
File Interpreter ABI Platform
datanerd-1.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / datanerd-1.2.tar.gz

Download URL datanerd-1.2.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
55e8543044255d7756cfe716d8b99b7402b9d5eada93607ee155a7248ce768ce
BLAKE2b-256 checksum
How to use checksums
bc759d128d0b8c0728004d995defe9fc8492135215e57c064a9feb0ec7d5e9c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.8.18

Release files / datanerd-1.2-py3-none-any.whl

Download URL datanerd-1.2-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62eb0ec18d16823fca7c83e37e7b5291a3d2691e4b085a8fdbddfa0f5ee46c60
BLAKE2b-256 checksum
How to use checksums
5184ec0c366685b453261f5b3b3520ea69bca959e9981022f6c28d94aed4e1f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.8.18

Security for datanerd 1.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page