Skip to main content

yz

Includes various adwords elements diagnosis functions

To install: pip install yz

Overview

The yz package provides a collection of functions designed to assist in diagnosing and analyzing data related to AdWords and other similar datasets. The functions in this package help in understanding the structure and characteristics of data frames, performing statistical analysis, and formatting output for reporting and inspection.

Features

  • Data Diagnostics: Analyze data frames to extract information about columns, such as data types, unique values, and non-null counts.
  • Comparison and Filtering: Functions to filter and compare data based on specified conditions.
  • Statistical Analysis: Aggregate and normalize data for detailed statistical insights.

Functions

diag_df(df)

Analyzes a DataFrame to provide a summary of each column including data type, a non-null example value, count of unique values, non-zero values, and non-NaN values.

Usage Example:

import pandas as pd
df = pd.DataFrame({
    'A': [1, 2, None, 4],
    'B': ['a', 'b', 'b', 'c']
})
summary = diag_df(df)
print(summary)

numof(logical_series)

Counts the number of True values in a logical series.

Usage Example:

import pandas as pd
data = pd.Series([True, False, True, True])
count = numof(data)
print(count)  # Output: 3

pr_numof(data, column=None, op=ge, comp_val=0, str_format='sparse', op2str=None)

Prints the number of elements in a specified column of a DataFrame that meet a comparison condition.

Usage Example:

import pandas as pd
df = pd.DataFrame({'Age': [25, 30, 35, 40]})
pr_numof(df, column='Age', op=ge, comp_val=30)

cols_that_are_of_the_type(df, type_spec)

Returns a list of columns where the type of the first element matches the specified type or meets a condition defined by a function.

Usage Example:

import pandas as pd
df = pd.DataFrame({
    'name': ['Alice', 'Bob'],
    'age': [25, 30]
})
cols = cols_that_are_of_the_type(df, int)
print(cols)  # Output: ['age']

get_unique(d, cols=None)

Returns a DataFrame with unique rows based on specified columns.

Usage Example:

import pandas as pd
df = pd.DataFrame({
    'A': [1, 1, 2],
    'B': [2, 2, 2]
})
unique_df = get_unique(df)
print(unique_df)

print_unique_counts(d)

Prints the count of unique values for each column in the DataFrame.

Usage Example:

import pandas as pd
df = pd.DataFrame({
    'A': [1, 1, 2],
    'B': ['x', 'y', 'x']
})
print_unique_counts(df)

mk_fanout_score_df(df, fromVars, toVars, statVars=None, keep_statVars=False)

Creates a DataFrame that scores fan-out relationships between variables.

Usage Example:

import pandas as pd
df = pd.DataFrame({
    'Company': ['A', 'A', 'B'],
    'Product': ['X', 'Y', 'X'],
    'Sales': [100, 150, 200]
})
score_df = mk_fanout_score_df(df, fromVars=['Company'], toVars=['Product'])
print(score_df)

Installation

To install the yz package, run the following command:

pip install yz

This package is essential for data scientists and analysts working with complex datasets, providing tools to simplify data diagnostics and analysis.

Metadata

Release files for yz 0.0.6

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

Source distribution (sdist)

Source distribution for yz 0.0.6
File Size Uploaded
yz-0.0.6.tar.gz 8.6 kB Details

Built distribution (wheel)

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

Total release size: 17.0 kB

Release files / yz-0.0.6.tar.gz

Download URL yz-0.0.6.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
06416624fa4b66b51c1937be2954e49b1cf90ab24bbeec4d9a393e0173f7ed02
BLAKE2b-256 checksum
How to use checksums
af297f8c3e9f2fce7f7f520b0164cb55764d80677dc66928f5a896c1e2cfa677
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / yz-0.0.6-py3-none-any.whl

Download URL yz-0.0.6-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57b916610154be46a8e121c4394cb22d17b74dfa3bfcc3f959083ffae527d3c9
BLAKE2b-256 checksum
How to use checksums
c7303b07514b19b80d1c76ec8164a2e11c539299da179b1a451df60f293e7846
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

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