mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
isort --profile black . (#2181)
* updating DIRECTORY.md
* isort --profile black .
* Black after
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Tuple, List
|
||||
from typing import List, Tuple
|
||||
|
||||
|
||||
def n31(a: int) -> Tuple[List[int], int]:
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
reference-->Su, Francis E., et al. "Fibonacci Number Formula." Math Fun Facts.
|
||||
<http://www.math.hmc.edu/funfacts>
|
||||
"""
|
||||
import math
|
||||
import functools
|
||||
import math
|
||||
import time
|
||||
from decimal import getcontext, Decimal
|
||||
from decimal import Decimal, getcontext
|
||||
|
||||
getcontext().prec = 100
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import math
|
||||
from scipy.integrate import quad
|
||||
|
||||
from numpy import inf
|
||||
from scipy.integrate import quad
|
||||
|
||||
|
||||
def gamma(num: float) -> float:
|
||||
|
||||
@@ -5,7 +5,7 @@ python/black : True
|
||||
python : 3.7.3
|
||||
|
||||
"""
|
||||
from numpy import pi, sqrt, exp
|
||||
from numpy import exp, pi, sqrt
|
||||
|
||||
|
||||
def gaussian(x, mu: float = 0.0, sigma: float = 1.0) -> int:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from typing import Callable, Union
|
||||
import math as m
|
||||
from typing import Callable, Union
|
||||
|
||||
|
||||
def line_length(
|
||||
|
||||
@@ -5,8 +5,8 @@ python/black : True
|
||||
flake8 : True
|
||||
"""
|
||||
|
||||
from maths.prime_factors import prime_factors
|
||||
from maths.is_square_free import is_square_free
|
||||
from maths.prime_factors import prime_factors
|
||||
|
||||
|
||||
def mobius(n: int) -> int:
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
limit is reached or the gradient f'(x[n]) approaches zero. In both cases, exception
|
||||
is raised. If iteration limit is reached, try increasing maxiter.
|
||||
"""
|
||||
|
||||
import math as m
|
||||
|
||||
|
||||
@@ -42,7 +41,7 @@ def newton_raphson(f, x0=0, maxiter=100, step=0.0001, maxerror=1e-6, logsteps=Fa
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib import pyplot as plt
|
||||
|
||||
f = lambda x: m.tanh(x) ** 2 - m.exp(3 * x) # noqa: E731
|
||||
solution, error, steps = newton_raphson(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from typing import Generator
|
||||
import math
|
||||
from typing import Generator
|
||||
|
||||
|
||||
def slow_primes(max: int) -> Generator[int, None, None]:
|
||||
|
||||
@@ -9,9 +9,9 @@ After through ReLU, the element of the vector always 0 or real number.
|
||||
Script inspired from its corresponding Wikipedia article
|
||||
https://en.wikipedia.org/wiki/Rectifier_(neural_networks)
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
import numpy as np
|
||||
from typing import List
|
||||
|
||||
|
||||
def relu(vector: List[float]):
|
||||
|
||||
@@ -3,8 +3,8 @@ Find Volumes of Various Shapes.
|
||||
|
||||
Wikipedia reference: https://en.wikipedia.org/wiki/Volume
|
||||
"""
|
||||
from typing import Union
|
||||
from math import pi, pow
|
||||
from typing import Union
|
||||
|
||||
|
||||
def vol_cube(side_length: Union[int, float]) -> float:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import datetime
|
||||
import argparse
|
||||
import datetime
|
||||
|
||||
|
||||
def zeller(date_input: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user