Commit 18122e99 authored by Simon Sebastian Humpohl's avatar Simon Sebastian Humpohl
Browse files

Add itertools module

parent f4573d70
......@@ -11,7 +11,7 @@ python develop
This will link the files into your environment instead of copying them. If you are on windows you can use [SourceTree]( which is a nice GUI for git.
# qutil.plotting
## qutil.plotting
`cycle_plots` helps you cycling through many plots with the arrow keys (there are probably much better functions for this out there)
`plot_2d_dataframe` helps you plot 2d data frames with numeric indices
......@@ -25,3 +25,6 @@ For an overview of the included functions, see the module docstring.
## qutil.qi
In this module there are some quantities and functions related to quantum information, like the Pauli matrices in different data types.
## qutil.itertools
This module contains a everything from `itertools`, `more_itertools` and custom functions.
"""Import everything from itertools, more_itertools and some custom functions """
from typing import Iterable, Generator, Any
from itertools import *
from more_itertools import *
def separate_iterator(it: Iterable, sep: Any) -> Generator:
"""separate_iterator('abcde', ',') --> a , b , c , d , e"""
it = iter(it)
yield from islice(it, 1)
yield from chain.from_iterable(zip(repeat(sep), it))
......@@ -33,7 +33,7 @@ setup(name='qutil',
package_dir={'qutil': 'qutil'},
install_requires=['numpy', 'hdf5storage', 'pandas'],
install_requires=['numpy', 'hdf5storage', 'pandas', 'more-itertools'],
"Programming Language :: Python :: 3",
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment