Initial draft: from_dummies
Converts dummy codes to categorical variables.

- [x] Closes [#8745](https://github.com/pandas-dev/pandas/issues/8745)
- [x] Passes atomic options tests
- [x] Passes linting tests
- [ ] Whatsnew entry

Tests will be expaneded with composite options and edgecases as soon as definition of final scope is complete.
~~I tried to mirror the `get_dummes` function wherever possible to ensure an as close inverse of the function as possible~~

Primary goal of the draft is to demonstrate the options I had in mind, optimization is the next step as soon as we decided what we want to keep, cut, or add. 
(Docstrings etc. will be added based on results)

Integration as method of `categorical`, as proposed in [#34426](https://github.com/pandas-dev/pandas/pull/34426), can be considerd as a next step if moving in that direction is planed.

## Current Options:

### no arguments
- Assumes all columns to be cateogries of the same variable which is called `categories`
    - example: 
        ```python
        >>> dummies
              a   b   c   d
        0     1   0   0   0      
        1     0   1   0   0      
        2     1   0   0   0
        3     0   0   0   1      
        4     0   0   1   0         

        >>> from_dummies(dummies)
            categories
        0       a      
        1       b       
        2       a
        3       d
        4       c     
        ```

### subset
-  Select which columns of the input `DataFrame` to include for decoding.
- `None`:
    - Assumes the entire passed `DataFrame` consists of dummy coded variables
- `List` or `Index`:
    - Just returns the decoded subset passed in the list. 
    - example: 
        ```python
        >>> dummies
           C    col1_a  col1_b  col2_a  col2_b  col2_c
        0  1       1       0       0       1       0
        1  2       0       1       1       0       0
        2  3       1       0       0       0       1

        >>> from_dummies(dummies, sep="_", subset=["col1_a", "col1_b", "col2_a", "col2_b", "col2_c"])
          col1    col2 
        0  a       b
        1  b       a 
        2  a       c
        ```

### variables **-- [REMOVED](https://github.com/pandas-dev/pandas/pull/41902#discussion_r650566136) --**
- Inverts the `prefix` argument of `get_dummies`
- Using: 
    ```python
    >>> dummies
      col1_a  col1_b  col2_a  col2_b  col2_c
    0    1       0       0       1       0
    1    0       1       1       0       0
    2    1       0       0       0       1
    ``` 
- `None`:
    - Variable names are taken from prefix.
    - example: 
        ```python
        >>> from_dummies(dummies, sep="_", variables=None)
          col1    col2 
        0   a       b
        1   b       a 
        2   a       c
        ```
- `str`:
    - Variable names are numbered from the passed string.
    - example:
        ```python
        >>> from_dummies(dummies, sep="_", variables="Varname")
           Varname1   Varname2 
        0     a          b
        1     b          a 
        2     a          c
        ```
- `List`:
    - Variable names are obtained (in order) from the passed list.
    - example:
        ```python
        >>> from_dummies(dummies, sep="_", variables=["One", "Two"])
            One     Two 
        0    a       b
        1    b       a 
        2    a       c
        ```
- `Dict`:
    - Variable names are obtained from passed prefix to variable mapping.
    - Currently orders the returned columns by index in the passed dictionary, not sure if that should be changed to strictly follow the order of prefixes in the dummy-data.
    - example:
        ```python
        >>> from_dummies(dummies, sep="_", variables={"col2": "One", "col1": "Two"})
            One     Two   
        0    b       a
        1    a       b
        2    c       a
        ```

### sep
- Separator used in the column names of the dummy categories they are character indicating the separation of the categorical names from the prefixes. For example, if your column names are `prefix_A` and `prefix_B`, you can strip the underscore by specifying `sep='_'`.
- Required argument if prefixes are to be separated as there is no default separator.
- `str`:
    - Splits columns by first instance of passed string to obtain variables and elements.
    - example: 
        ```python
        >>> dummies
           col1_a  col1_b  col2_a  col2_b  col2_c
        0    1       0       0       1       0
        1    0       1       1       0       0
        2    1       0       0       0       1
 
        >>> from_dummies(dummies, sep="_")
           col1    col2 
        0   a       b
        1   b       a 
        2   a       c
        ```
- `list`:
    - Splits columns by first instance of any of the seperators passed in the list.
    - example:
        ```python
        >>> dummies
          col1_a  col1_b  col2-a  col2-b  col2-c
        0   1       0       0       1       0
        1   0       1       1       0       0
        2   1       0       0       0       1
        
        >>> from_dummies(dummies, sep=["_", "-"]) 
           col1    col2 
        0   a       b
        1   b       a 
        2   a       c
        ```
- `list`:
    - Splits columns with prefix by first instance of corresponding seperator.
    - example: 
        ```python
        >>> dummies
           col1_a-a  col1_b-b  col_2-a   col_2-b   col_2-c
        0     1         0         0         1         0
        1     0         1         1         0         0
        2     1         0         0         0         1

        >>> from_dummies(dummies, sep={"col1": "_", "col_2": "-"})
            col1     col_2 
        0    a-a       b
        1    b-b       a 
        2    a-a       c
        ```

### dummy_na **-- [REMOVED](https://github.com/pandas-dev/pandas/pull/41902#discussion_r652048588) --**
-  mirrors the `dummy_na` argument of `get_dummies`
- `False` but contains NaN:
    - Considers row with no assignments as NaN.
    - example: 
        ```python
        >>> dummies
           col1_a  col1_b  col2_a  col2_b  col2_c
        0    1       0       0       0       0
        1    0       1       1       0       0
        2    0       0       0       0       1

        >>> from_dummies(dummies, sep="_", dummy_na=False)
            col1    col2 
        0    a      NaN
        1    b       a 
        2   NaN      c
        ```
- `True`:
    - Considers row with no assignments as NaN.
    - example: 
        ```python
        >>> dummies
           col1_a  col1_b  col1_NaN  col2_a  col2_b  col2_c col2_NaN
        0    1       0        0        0       0       0       1
        1    0       1        0        1       0       0       0
        2    0       0        1        0       0       1       0

        >>> from_dummies(dummies, sep="_", dummy_na=True)
           col1    col2 
        0   a      NaN
        1   b       a 
        2  NaN      c
        ```

### dropped_first
- Inverts the `drop_first` argument of `get_dummies`
- Using: 
    ```python
    >>> dummies
       col1_a  col1_b  col2_a  col2_b  col2_c
    0     1       0       0       0       0
    1     0       1       1       0       0
    2     0       0       0       0       1
    ``` 
- `None`: **-- [REMOVED](https://github.com/pandas-dev/pandas/pull/41902#discussion_r683637232) --**
    - Without `dummy_na=True` non-asigned rows are considered NaN.
    - example:
        ```python
        >>> from_dummies(dummies, sep="_", dropped_first=None)
           col1    col2 
        0    a      NaN
        1    b       a 
        2   NaN      c
        ```
- `str`:
    - Assumes all missing assignemtns to be dropped category of the passed type.
    - example:
        ```python
        >>> from_dummies(dummies, sep="_", dropped_first="x")
           col1    col2 
        0    a       x
        1    b       a 
        2    x       c
        ```
- `List`:
    - Dropped cateogries for variables are obtained (in order) from the passed list.
    - example:
        ```python
        >>> from_dummies(dummies, sep="_", dropped_first=["x", "y"])
           col1    col2 
        0    a       y
        1    b       a 
        2    x       c
        ```
- `Dict`:
    - Dropped cateogries for variables are obtained from the passed prefix to dropped category mapping.
    - example: 
        ```python
        >>> from_dummies(dummies, sep="_", dropped_first={"col2": "x", "col1": "y"})
           col1    col2 
        0    a       x
        1    b       a 
        2    y       c
        ```
       
### fillna **-- [REMOVED](https://github.com/pandas-dev/pandas/pull/41902#discussion_r663350073) --**
- Using: 
    ```bash
    >>> dummies
       col1_a  col1_b  col2_a  col2_b  col2_c
    0     1       0       0      NaN      0
    1     0       1       1       0       0
    2     0      Nan      0       0       1
    ``` 
- `True`:
    - Can result in double assignemnt, which will raise the respective error.
    - example:
        ```bash
        >>> from_dummies(dummies, sep="_", fillna=True)
           col1    col2 
        0    a       b
        1    b       a 
        2    b       c
        ```
- `False`:
    - Can result in unassigned row which will be treated as any other unassigned row.
    - example:
        ```bash
        >>> from_dummies(dummies, sep="_", fillna=False)
           col1    col2 
        0    a      NaN
        1    b       a 
        2   NaN      c
        ```

## To Discuss:
1. Change, remove, or add options?


## To-Do
- [x] Add handling of NA values in input
- [ ] Adapt discussed changes ([~~C1~~](https://github.com/pandas-dev/pandas/pull/41902#discussion_r650566136), [~~C2~~](https://github.com/pandas-dev/pandas/pull/41902#discussion_r652048588))
- [ ] Expand tests
- [ ] Work on optimization ([O1](https://github.com/pandas-dev/pandas/pull/41902#discussion_r652048104))
- [ ] Raise relevant errors
- [ ] Whatsnew entry

