semvec/pypi-packages huggingface dataset:
hieroskopia 0.1.30
The hiereskopia package is a library to infer properties like date formats or numeric separators in pandas series of type object or string.
Requires Python: >=3.6

# Hieroskopia
[![codecov](https://codecov.io/gh/simetrikinc/hieroskopia/branch/master/graph/badge.svg)](https://codecov.io/gh/simetrikinc/hieroskopia)


The hiereskopia package is a library to infer properties like date formats or numeric separators in pandas series of type object or string. 

## Support 
### Date-times:
- Support to dates and datetime format
- This library receive a series as input and try to return
 a dictionary with the format found in the series Based on the 1989 C (__Default__) ,
 Snowflake Standard or Java Simple date time format code. 

### Numeric:
- This library receive a series as input and try to return
 a dictionary with the three digit and decimal character separator

## Usage

#### Infer datetime or date

````Python
>>> from hieroskopia import InferDatetime
>>> InferDatetime.infer(pd.Series(["2019-11-27",
                     "2019/11/28",
                     "2018-11-08"]))
>>> {'formats': ['%Y-%m-%d', '%Y/%m/%d'], 'type':'date'}
````
Using `return_format` parameter  
````Python
>>> from hieroskopia import InferDatetime
>>> InferDatetime.infer(pd.Series(["2019-11-27",
                     "2019/11/28",
                     "2018-11-08"]), return_format='snowflake')
>>> {'formats': ['yyyy-mm-dd', 'yyyy/mm/dd'], 'type':'date'}
````

````Python
>>> from hieroskopia import InferDatetime
>>> InferDatetime.infer(pd.Series(["2019-11-27",
                     "2019/11/28",
                     "2018-11-08"]), return_format='java')
>>> {'formats': ['yyyy-MM-dd', 'yyyy/MM/dd'], 'type':'date'}
````
The above method works with a best guess approach to detect a format in a object type series and try 
to return a `datetime.strftime`/`strptime`, `Snowflake Date format`, `Java Simple Date Format` format that will cover or parse the majority
of the samples.


#### Infer numeric

````Python
>>> from hieroskopia import InferNumeric
>>> InferNumeric.infer(pd.Series(['767313628196.2', '76731362819.546', '767313628196']))
>>> {'three_digit_separator': '', 'decimal_separator': '.', 'type':'float'}
````

The above method will try to detect and return certain properties in a object type series
like `datatype`, `three_digit_separator` or `decimal_separator` character that will cover 
the majority of the samples.
BalanceEvolution 0.11
Monte Carlo simulations of the trading account evolution based on the winning ratio and risk-reward relation of a trading plan.

This package allows the user to estimate the evolution of a trading account after a prescribed 
number of trades using a Monte Carlo (MC) algorithm. The input of the algorithm is the winning ratio 
and the risk-reward relation associated with a trading plan, which supposedly has been extensively 
tested by the user.

The *mc* module implements a single class, *Simulation*, which should be instantiated by the user and 
which provides a number of methods and properties, such as the ones for calculating the average balance of the 
MC-generated trading paths, giving an estimate of the long run performance of a trading plan, and, perhaps 
more importantly, the probability of ruin, which is the probability of zeroing out a trading account when 
the trader strictly follows a trading plan.

### Basic Usage Example

---

    # Estimate of the probability of ruin of a trading strategy

    # Input variables
    winratio=0.40     # Winning ratio of the strategy (must be between 0 and 1)
    capital=1000.0    # Initial capital
    profit=20.0       # Profit per winning trade (must be a positive number)
    loss=-10.0        # Loss per losing trade (must be a negative number)
    npaths=1000       # Number of independent trading paths
    ntrades=1000      # Maximum number of trades per trading path

    # Run a Monte Carlo simulation
    from BalanceEvolution import mc

    s=mc.Simulation()
    s.setparams(winratio,capital,profit,loss,npaths,ntrades)
    s.run()

    # Plot trading paths
    s.plottradingpaths()

    # Plot histogram of final account balances
    s.plothist()

    # Average balance, standard devation, maximum and minimum
    s.getavgbalance()

    # Avgerage consecutive wins, stdandard deviation, maximum and minimum
    s.getavgconsecutivewins()

    # Avgerage consecutive losses, stdandard deviation, maximum and minimum
    s.getavgconsecutivelosses()

    # Probability of ruin
    print(s.ruinprob)