semvec/pypi-packages huggingface dataset:
python-percentage 1.0.0
Calculate percentages without worrying about ZeroDivision errors
License: MIT
Keywords: calculate percentages,python percentage,float percentage,zerodivision,zero division

# Python Percentage

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rogervila_python_percentage&metric=alert_status)](https://sonarcloud.io/dashboard?id=rogervila_python_percentage)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=rogervila_python_percentage&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=rogervila_python_percentage)


Calculate percentages without worrying about ZeroDivision errors


## Install

```sh
pip install python_percentage
```

## Usage

`python_percentage` comes with different useful functions for different percentage calculations

### Calculate percentage between 2 floats

```py
from python_percentage import get_percentage

# I want to get the 20.0% of 200.0
result = get_percentage(20.0, 200.0)
# 200.0 * float(20.0) / float(100.0)

print(result) # 40.0
```

### Calculate which percentage represents a float based on another float

```py
from python_percentage import percentage_of

# I want to get which percentage is 1.0 of 2.0
result = percentage_of(1.0, 2.0)
# 100.0 * float(1.0) / float(2.0)

print(result) # 50.0
```

### Increment percentage of a float

```py
from python_percentage import increment

# I want to increment a 10.0% the float 20.0
result = increment(10.0, 20.0)
# 20.0 + get_percentage(10.0, 20.0)

print(result) # 22.0
```

### Decrement percentage of a float

```py
from python_percentage import decrement

# I want to decrement a 10.0% the float 20.0
result = decrement(10.0, 20.0)
# 20.0 - get_percentage(10.0, 20.0)

print(result) # 18.0
```
slurm-to-wandb 0.1.2
Uploads SLURM job information to WandB for better monitoring.
License: MIT

# slurm-to-wandb
[![build status](https://github.com/dunnkers/slurm-to-wandb/actions/workflows/python-app.yml/badge.svg)](https://github.com/dunnkers/slurm-to-wandb/actions/workflows/python-app.yml) [![pypi badge](https://img.shields.io/pypi/v/slurm-to-wandb.svg?maxAge=3600)](https://pypi.org/project/slurm-to-wandb/)

 Monitor SLURM jobs using Weights and Biases (wandb) 📊

## Usage
On your cluster, login to wandb using the [cli](https://github.com/wandb/client), then run:

```shell
pip install slurm-to-wandb
slurm_to_wandb <job_ids>
```

... to upload all `sacct` information to wandb. Currently, uploads to a project called "peregrine" - support for configuring this is planned #4. `<job_ids>` can be multiple space-separated job ids. In the case multiple job id's match, all matched job ids are uploaded (useful, for example, when using job arrays).

To construct a DataFrame with the information yourself, use the function `slurm_to_wandb.sacct_as_df(*job_ids, **sacct_args)`. `sacct_args` can be any additional args to pass to `sacct`. Run it on the cluster:

```python
from slurm_to_wandb import sacct_as_df

df = sacct_as_df("job_id_123", "another_job_id", starttime="2021-05-20")
df
```

You can now upload the information to wandb however you like 🙌🏻

## About
By [Jeroen Overschie](https://dunnkers.com/).
dstree 3.4
A module for visualization of a nested python data structure
License: MIT
Requires Python: >=3.6

### A module for visualization of a nested python data structure
***

a nested python objects including list, tuple, dictionary, tensor, ndarray to data-tree, and make a quick peek out of its structure

```
data = a list of 10 lists of 3 dicts of 2 keys : list of 2 strings

dv.viz(data)

$ list of 10
$ └── list of 3
$     └── dict of 2
$         ├── train : ['data1', 'data2']
$         └── test : ['data3', 'data4']

```

### How to use
***
#### install
```
$ pip install dstree
```
#### import and quick_start
```python
import dstree as dst

data = dst.get_example_data()
tree = dst.viz(data)
```
#### usage in detail
```python
import dstree as dst
dst.quick_start() # Copy & Paste console output to set up the tutorial codes
```

### Note
This package is built based on treelib & graphviz syntax.  
Supports int, str, float, list, tuple, dict, Tensor, ndarray, Series, DataFrame datatype.  
And also custom data classes are supported.