semvec/pypi-packages huggingface dataset:
spd-stats 0.1.0
Statistical Probability Distributions Package
Requires Python: >=3.6

# spd_stats: Statistical Probability Distributions Package

## Description:

spd_stats is a Python package designed for statistical analysis, calculation, and visualization of various probability distributions. It provides classes for representing and manipulating Gaussian and Binomial distributions, along with generic distribution functionalities.


## Installation:

To install spd_stats, simply use pip:

```bash
pip install spd_stats
```


## Usage

```bash
# Import Gaussian and Binomial distributions from spd_stats
from spd_stats import Gaussian, Binomial

# Create a Gaussian distribution with mean 0 and standard deviation 1
gaussian = Gaussian(0, 1)

# Create a Binomial distribution with probability 0.5 and size 20
binomial = Binomial(0.5, 20)

# Read data from a file into a distribution
gaussian.read_data_file("gaussian_data.txt")
binomial.read_data_file("binomial_data.txt")

# Calculate and print mean and standard deviation of distributions
print("Gaussian Mean:", gaussian.mean)
print("Gaussian Standard Deviation:", gaussian.stdev)
print("Binomial Mean:", binomial.mean)
print("Binomial Standard Deviation:", binomial.stdev)

# Plot histograms and probability density functions
gaussian.plot_histogram()
gaussian.plot_histogram_pdf()
binomial.plot_bar()
binomial.plot_bar_pdf()

# Add two distributions together
sum_distribution = gaussian + gaussian

# Output characteristics of the sum distribution
print("Sum Distribution:", sum_distribution)
```


## Classes:

### Gaussian:
Represents a Gaussian (normal) distribution.
Attributes: mean, standard deviation, data.
Methods: calculate_mean, calculate_stdev, plot_histogram, pdf, plot_histogram_pdf, add, repr.

### Binomial:
Represents a Binomial distribution.
Attributes: mean, standard deviation, data, p (probability of success), n (number of trials).
Methods: calculate_mean, calculate_stdev, replace_stats_with_data, plot_bar, pdf, plot_bar_pdf, add, repr.

### Distribution:
Generic distribution class.
Attributes: mean, standard deviation, data.
Methods: read_data_file.

## Contributing:

Thank you for your interest in contributing to spd_stats! At the moment, there is no specific content outlined for contributing guidelines. However, we welcome your input and contributions once we establish the guidelines.
 
 
## License:

This package is licensed under the MIT License.


## Author:

Pradeep Sahani
dict-tape 1.3.0
A collection of utilities for working with Dictionaries in Python.
Requires Python: >=3.12

# dict-tape

_A collection of Python utilities for manipulating dictionaries_

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/O5O7V0GB2)

## Installation

```bash
pip install dict-tape
```

## Usage

```python
from dict_tape import chain_get
```

## Features

### Traversal

#### `chain_get`

This is intended to help solve problems like this with deeply nested dictionaries:

```python
some_dict.get('a', {})[0].get('b', {}).get('e', 'default')
```

The problem is that while `.get()` can help with chains of dictionaries, if you have lists
intermixed in there, you can't sanely default things and have to just hope the list has items
(since list indexing will throw an exception if the list is empty).

But with `chain_get()` you can accomplish this in a way that will sanely default:

```python
from dict_tape import chain_get

some_dict = {'a': [{'b': {'e': 'value'}}]}
# Prints 'value'
print(chain_get(some_dict, 'a', 0, 'b', 'e', default='default'))

some_dict = {'a': []}
# Prints 'default'
print(chain_get(some_dict, 'a', 0, 'b', 'e', default='default'))
```

`chain_get()` will also do some sanity checking on your types and arguments:

- Checks to make sure that every new level is a `dict`, `list`, or `str`
- If the current data being indexed is a `list` or `str`, it will check that the arg provided is an `int`
- If the current data being indexed is a `dict`, it will check that the arg provided is an `int` or `str`
- If the resulting data it finds with traversal doesn't match the type provided for `default`, it will throw an error so you know you got something you apparently didn't expect

**Options**

- `default`:  The default value to return if the chain fails at any point.
- `check_arg_types`:  You can set this to `False` to disable checking whether arg types are valid for data.  If this is disabled, when it would normally throw an error for this problem it will instead return the `default` value.
- `check_data_types`:  You can set this to `False` to disable checking whether the data types are valid.  If this is disabled, when it would normally throw an error for this problem it will instead return the `default` value.