Skip to main content

Includes various adwords elements diagnosis functions

Project description

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.

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

yz-0.0.5.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

yz-0.0.5-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file yz-0.0.5.tar.gz.

File metadata

  • Download URL: yz-0.0.5.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for yz-0.0.5.tar.gz
Algorithm Hash digest
SHA256 3e2a4a2d7c7957f0346f393e4cf4d528284e6ee92bd02cef991b5470bee3d857
MD5 71821d8e8810f617dbf4387e42b74666
BLAKE2b-256 ce050cf47d370ad3fa9dfca79515a951329fe310b0c688892dda6bbbf9de474e

See more details on using hashes here.

File details

Details for the file yz-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: yz-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for yz-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 dee74fdcb706e3f9492238c8de6a95d7307b0ea5c03f4e57480f8ed1f5a19a8e
MD5 73a9c23e5192f4777ff2031947f538a5
BLAKE2b-256 cb50bb24c1033ef83410f3b9f81275ad820bf1377649c0aac25b4426a5d38fdb

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