semvec/pypi-packages huggingface dataset:
tnorma 0.0.3
Temporal normalization (from 0 to 100% with step interval)
Requires Python: >=3.6

# [tnorma](https://pypi.org/project/tnorma/)

Temporal normalization (from 0 to 100% with step interval).

Temporal normalization is usually employed for the temporal alignment of data obtained from different trials with different duration (number of points). This code implements a procedure knwown as the normalization to percent cycle.

This code can perform simple linear interpolation passing through each datum or spline interpolation (up to quintic splines) passing through each datum (knots) or not (in case a smoothing parameter > 0 is inputted).

NaNs and any value inputted as a mask parameter and that appears at the extremities might be removed or replaced by the first/last not-NaN value before the interpolation because this code does not perform extrapolation.  
For a 2D array, the entire row with NaN or a mask value at the extermity might be removed because of alignment issues with the data from different columns. As result, if there is a column of only NaNs in the data, the temporal normalization can't be performed (an empty NaNs and any value inputted as a mask parameter and that appears in the middle of the data (which may represent missing data) are ignored and the interpolation is performed through these points.

## Installation

```bash
pip install tnorma
```

Or

```bash
conda install -c duartexyz tnorma
```

## Examples

```python
>>> # Default options: cubic spline interpolation passing through
>>> # each datum, 101 points, and no plot
>>> y = [5,  4, 10,  8,  1, 10,  2,  7,  1,  3]
>>> tnorma(y)

>>> # Deal with missing data (use NaN as mask)
>>> x = np.linspace(-3, 3, 100)
>>> y = np.exp(-x**2) + np.random.randn(100)/10
>>> y[:10] = np.NaN # first ten points are missing
>>> y[30: 41] = np.NaN # make other 10 missing points
>>> yn, tn, indie = tnorma(y, step=-50, k=3, smooth=1, show=True)

>>> # Deal with 2-D array
>>> x = np.linspace(-3, 3, 100)
>>> y = np.exp(-x**2) + np.random.randn(100)/10
>>> y = np.vstack((y-1, y[::-1])).T
>>> yn, tn, indie = tnorma(y, step=-50, k=3, smooth=1, show=True)
```

- [tnorma.ipynb](https://github.com/demotu/tnorma/blob/master/docs/tnorma.ipynb)

## How to cite this work

Here is a suggestion to cite this GitHub repository:

> Duarte, M. (2020) tnorma: A Python module for temporal normalization (from 0 to 100% with step interval), <https://github.com/demotu/tnorma>.

And a possible BibTeX entry:

```tex
@misc{Duarte2020,  
    author = {Duarte, M.},
    title = {tnorma: A Python module for temporal normalization (from 0 to 100% with step interval)},  
    year = {2020},  
    publisher = {GitHub},  
    journal = {GitHub repository},  
    howpublished = {\url{https://github.com/demotu/tnorma}}  
}
```

## License

The non-software content of this project is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/), and the software code is licensed under the [MIT license](https://opensource.org/licenses/mit-license.php).
pyversions 0.0.3
Get versions of all imported modules in current session
Requires Python: >=3.6

# [pyversions](https://pypi.org/project/pyversions/)

Get versions of imported modules in current session: pyversions.versions()

Designed particularly to work within a Jupyter notebook.  
Call this function in a cell just after all modules/functions are imported.  
This function uses Python inspect module to get the caller's global namespace; it should work, if not, pass globals() as a parameter.

## Installation

```bash
pip install pyversions
```

Or

```bash
conda install -c duartexyz pyversions
```

## Examples

```python
>>> import pyversions
>>> vs = pyversions.versions()

>>> from pyversions import versions
>>> versions();  # semicolon to avoid printing information twice
```

- [In a Jupyter notebook](https://github.com/demotu/pyversions/blob/master/docs/pyversions.ipynb)

## Help

```python
"""
Get versions of imported modules in current session: pyversions.versions()

Parameters
----------
glbs : globals(), optional (default=None)
    Get all the imported modules from the passed globals() namespace.
show : bool, optional (default=True)
    Whether to print information about environment and imported modules.

Returns
-------
info : list of strings
    list of strings with information about the current environment and
    imported modules.

Notes
-----
Designed particularly to work within a Jupyter notebook.
Call this function in a cell just after all modules/functions are imported.
This function uses Python inspect module to get the caller's global
namespace; it should work, if not, pass globals() as a parameter.

Based on https://stackoverflow.com/questions/40428931

Examples
--------
>>> import pyversions
>>> vs = pyversions.versions()

>>> from pyversions import versions
>>> versions();  # semicolon to avoid printing information twice

[In a Jupyter notebook](https://github.com/demotu/pyversions/blob/master/docs/pyversions.ipynb)  

Version history
---------------
'0.0.1' :
    The first version

"""
```

## How to cite this work

Here is a suggestion to cite this GitHub repository:

> Duarte, M. (2020) pyversions: A Python module to get versions of imported modules in current session. GitHub repository, <https://github.com/demotu/pyversions>.

And a possible BibTeX entry:

```tex
@misc{Duarte2020,  
    author = {Duarte, M.},
    title = {pyversions: A Python module to get versions of imported modules in current session},  
    year = {2020},  
    publisher = {GitHub},  
    journal = {GitHub repository},  
    howpublished = {\url{https://github.com/demotu/pyversions}}  
}
```

## License

The non-software content of this project is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/), and the software code is licensed under the [MIT license](https://opensource.org/licenses/mit-license.php).
ezdict 1.0.0
Making Python's `dict` easier to work with by adding object notation and grouping
Requires Python: >=3.5

# EZDict

Making Python's `dict` easier to work with by adding object notation and grouping.
 1. Allows keys to be accessed as attributes, so `ezdict.attr` can be used instead of 
 `ezdict["attr"]`. Note, this only works with string keys. Additionally, any
 keys that overlap with method names will be shadowed, so to access the key `keys`,
 use `ezdict["keys"]` instead of `ezdict.keys`.
 2. Provide two methods, `incrementer` and `appender`, to support the common operations
 of counting the occurrences of a key and grouping values by a key, respectively.

## Installation

```
pip install ezdict
```

## Import

```python
from ezdict import EZDict
```

## Usage

### Accessing Keys as Attributes

```python
from ezdict import EZDict

ez = EZDict({
    "id": "5e2797c05aa0585816ce8b8c",
    "title": "EZDict",
    "description": "Super cool Python package",
    "author": "Jacob Morris (BlendingJake)",
    "meta": {
        "created": "March 27th, 2020"
    }
})

print(ez.title)  # >>> "EZDict"
print(ez.meta.created)  # >>> "March 27th, 2020"
```

### Grouping/Counting Like a Pro
```python
from ezdict import EZDict

# tried of this?
iterable = [ ... ]
grouped = {}
for item in iterable:
    if item["key"] in grouped:
        grouped[item["key"]] += 1
        # OR grouped[item["key"]].append(item)
    else:
        grouped[item["key"]] = 1
        # OR grouped[item["key"]] = [item]

# do this instead
iterable = [ ... ]
grouped = EZDict()
for item in iterable:
    grouped.incrementer(item["key"])
    # OR grouped.appender(item["key"], item)
```

#### `incrementer(key, increment=1)`

>Increment `key` by `increment` if the key has already been seen. Otherwise,
>set the key equal to `increment`.


#### `appender(key, value)`

>Append `value` to the list of values associated with `key` if that key was
>already been seen. Otherwise, set the key equal to `[value]`.
optcutfreq 0.0.8
Automatic search of optimal filter cutoff frequency based on residual analysis
Requires Python: >=3.6

# [optcutfreq](https://pypi.org/project/optcutfreq)

Automatic search of optimal filter cutoff frequency based on residual analysis

The 'optimal' cutoff frequency (in the sense that a filter with such cutoff frequency removes as much noise as possible without considerably affecting the signal) is found by performing a residual analysis of the difference between filtered and unfiltered signals over a range of cutoff frequencies.  
The optimal cutoff frequency is the one where the residual starts to change very little because it is considered that from this point, it's being filtered mostly noise and minimally signal, ideally.

## Installation

```bash
pip install optcutfreq
```

Or

```bash
conda install -c duartexyz optcutfreq
```

## Examples

```python
>>> y = np.cumsum(np.random.randn(1000))
>>> # optimal cutoff frequency based on residual analysis and plot:
>>> fc_opt = optcutfreq(y, freq=1000, show=True)

>>> # sane analysis but specifying the frequency limits and plot:
>>> optcutfreq(y, freq=1000, fclim=[200,400], show=True)

>>> # It's not always possible to find an optimal cutoff frequency
>>> # or the one found can be wrong (run this example many times):
>>> y = np.random.randn(100)
>>> optcutfreq(y, freq=100, show=True)
```

- [In a Jupyter notebook](https://github.com/demotu/optcutfreq/blob/master/docs/optcutfreq.ipynb)

## How to cite this work

Here is a suggestion to cite this GitHub repository:

> Duarte, M. (2020) optcutfreq: Automatic search of optimal filter cutoff frequency based on residual analysis. GitHub repository, <https://github.com/demotu/optcutfreq>.

And a possible BibTeX entry:

```tex
@misc{Duarte2020,  
    author = {Duarte, M.},
    title = {optcutfreq: Automatic search of optimal filter cutoff frequency based on residual analysis},  
    year = {2020},  
    publisher = {GitHub},  
    journal = {GitHub repository},  
    howpublished = {\url{https://github.com/demotu/optcutfreq}}  
}
```

## License

The non-software content of this project is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/), and the software code is licensed under the [MIT license](https://opensource.org/licenses/mit-license.php).
detecta 0.0.5
Detect events in data
Requires Python: >=3.6

# [detecta](https://pypi.org/project/detecta/)

Python module to detect events in data

The following functions are implemented in detecta:  

- **detect_peaks.py**: detects peaks in data based on their amplitude and other features.  
- **detect_onset.py**: detects onset in data based on amplitude threshold.  
- **detect_cusum.py**: detects abrupt changes in data using cumulative sum algorithm (CUSUM).  
- **detect_seq.py**: detects initial and final indices of sequential data identical to a parameter.

## Installation

```bash
pip install detecta
```

Or

```bash
conda install -c duartexyz detecta
```

## Examples

- [detect_peaks](https://nbviewer.jupyter.org/github/demotu/detecta/blob/master/docs/detect_peaks.ipynb)  
- [detect_onset](https://nbviewer.jupyter.org/github/demotu/detecta/blob/master/docs/detect_onset.ipynb)  
- [detect_cusum](https://nbviewer.jupyter.org/github/demotu/detecta/blob/master/docs/detect_cusum.ipynb)  
- [detect_seq](https://nbviewer.jupyter.org/github/demotu/detecta/blob/master/docs/detect_seq.ipynb)  

## How to cite this work

Here is a suggestion to cite this GitHub repository:

> Duarte, M. (2020) detecta: A Python module to detect events in data. GitHub repository, <https://github.com/demotu/detecta>.

And a possible BibTeX entry:

```tex
@misc{Duarte2020,  
    author = {Duarte, M.},
    title = {detecta: A Python module to detect events in data},  
    year = {2020},  
    publisher = {GitHub},  
    journal = {GitHub repository},  
    howpublished = {\url{https://github.com/demotu/detecta}}  
}
```

## License

The non-software content of this project is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/), and the software code is licensed under the [MIT license](https://opensource.org/licenses/mit-license.php).