semvec/pypi-packages huggingface dataset:
pandas-refract 1.2.5
Unofficial convenience functions that deal with fragmenting Pandas dataframes.
License: MIT


==================================================================
``pandas-refract``: Convenient dataframe fragmentation functions
==================================================================

**pandas-refract** is an MIT licensed Python package with a simple function that allows users to divide their 
dataframes by the 'Truthy' and 'Falseyness' of a provided array.

Because this library deals with splitting dataframes by its values, it uses imagery of light - refract and disperse, like light entering a prism.
Eventually, the goal of this package is additional features to the Pandas library that allows users to .pop rows
from a dataframe where a condition is met, etc. As far as I can tell this is not possible like the below example.

Ideal case would be::

    target_df = df.pop(df['target_column'] == 'target_value')
    non_target_df = df

What is required now is::

    target_df = df[df['target_column'] == 'target_value'] 
    non_target_df = df[df['target_column'] != 'target_value']

With pandas-refract this becomes::

    target_df, non_target_df = refract(df, df['target_column'] == 'target_value']]


Obviously, this package is not providing anything not currently possible in the current Pandas library. It does,
however, add a layer of convenience for more complex slicing where you need to separate, not remove, rows by conditions.


Examples
========

Simplest example of current Pandas requires::

    df1 = df[df.column.notnull()].reset_index(drop=True)
    df2 = df[df.column.isnull()].reset_index(drop=True)

or::

    df1 = df[df.column == 'test_string'].reset_index(drop=True)
    df2 = df[df.column != 'test_string'].reset_index(drop=True)


With pandas-refract this becomes::

    df1, df2 = refract(df, df.column.notnull(), True]

and::

    df1, df2 = refract(df, df.column == test_string', True]   


But you don't have to pass it explicit boolean arrays::

    data = {'a': ['', 'truthy', '', 'truthy'],
            'b': [0, 1, 2, 3]
            }

    df = pd.DataFrame(data)

    truthy_df, falsey_df = refract(df, df.a)


More complex examples:
*(where 'a' is Falsey and 'b' is an odd number)*
::

    df1, df2 = refract(df, ((~df.a) & (df.b % 2 == 1)))
bdd-tester 0.0.8
A very very basic BDD test runner
License: MIT

BDD Tester
==========

.. image:: https://img.shields.io/pypi/v/bdd-tester.svg
    :alt: PyPI Package latest release
    :target: https://pypi.org/project/bdd-tester/

.. image:: https://img.shields.io/pypi/l/bdd-tester.svg
    :alt: License
    :target: https://pypi.org/project/bdd-tester/

.. image:: https://img.shields.io/travis/pwyf/bdd-tester/master.svg
    :alt: Travis-CI Build Status
    :target: https://travis-ci.org/pwyf/bdd-tester

.. image:: https://img.shields.io/coveralls/github/pwyf/bdd-tester/master.svg
    :alt: Test coverage
    :target: https://coveralls.io/github/pwyf/bdd-tester?branch=master

Test data files using `behaviour-driven
development <https://en.wikipedia.org/wiki/Behavior-driven_development>`__
tests, in python.

Wait, what?
-----------

It’s a tool to run
`Gherkin <http://pythonhosted.org/behave/philosophy.html#the-gherkin-language>`__
tests (features) against (IATI) data – similar to `Cucumber <https://cucumber.io>`__
(in Ruby) or `Behave <https://pythonhosted.org/behave/>`__ (in Python).
`Here’s a blog that nicely explains the idea. <http://blog.memespring.co.uk/2014/07/16/programatically-testing-regulatory-data/>`__


Install
-------

.. code:: shell

    pip install bdd_tester

Run
---

.. code:: shell

    bdd_tester --feature [Feature file] --steps [Step file] [Data file]

For more options, run:

.. code:: shell

    bdd_tester --help

Using it programmatically
-------------------------

.. code:: python

    from bdd_tester import BDDTester


    tester = BDDTester(step_definitions_filepath)
    feature = tester.load_feature(feature_filepath)
    result = feature.tests[0](*args, **kwargs)