Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ bb473f6ff4a23e4fd5205eacdef713db15decadf
8d00b416689c428b2bafdaad61ed3ec660ca06c2
d6b447cab8c40aa47dc675a0f4349ae254e8b3ce
d8966d848af75751823e825eb76c5bbff58f5c07
9980f7a61b32515a92a09fdcc27e21a2521a0467
2 changes: 1 addition & 1 deletion advanced/advanced_numpy/examples/mandelplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

"""

import numpy as np
import mandel
import numpy as np

x = np.linspace(-1.7, 0.6, 1000)
y = np.linspace(-1.4, 1.4, 1000)
Expand Down
2 changes: 1 addition & 1 deletion advanced/advanced_numpy/examples/pilbuffer-answer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
the buffer interface.
"""

import numpy as np
import Image
import numpy as np

# Let's make a sample image, RGBA format

Expand Down
2 changes: 1 addition & 1 deletion advanced/advanced_numpy/examples/pilbuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Skeletton of the code to do an exercise using the buffer protocole.
"""

import numpy as np
import Image
import numpy as np

# Let's make a sample image, RGBA format

Expand Down
2 changes: 1 addition & 1 deletion advanced/advanced_numpy/examples/plots/plot_maskedstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

"""

import numpy as np
import matplotlib.pyplot as plt
import numpy as np

data = np.loadtxt("../../../../data/populations.txt")
populations = np.ma.masked_array(data[:, 1:])
Expand Down
3 changes: 2 additions & 1 deletion advanced/advanced_numpy/examples/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

import os
import sys
from os.path import join
from distutils.sysconfig import get_python_inc
from os.path import join

import numpy
from numpy.distutils.misc_util import get_numpy_include_dirs

Expand Down
2 changes: 1 addition & 1 deletion advanced/advanced_numpy/examples/setup_myobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

"""

from distutils.core import setup, Extension
from distutils.core import Extension, setup

setup(
name="myobject",
Expand Down
1 change: 1 addition & 0 deletions advanced/advanced_numpy/examples/wavreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

import sys

import numpy as np

wav_header_dtype = np.dtype(
Expand Down
2 changes: 1 addition & 1 deletion advanced/debugging/wiener_filtering.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Wiener filtering a noisy raccoon face: this module is buggy"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt


def local_mean(img, size=3):
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_GMM.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
from sklearn.mixture import GaussianMixture

rng = np.random.default_rng(27446968)
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_block_mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
blocks of an image.
"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

f = sp.datasets.face(gray=True)
sx, sy = f.shape
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_blur.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
An example showing various processes that blur an image.
"""

import scipy as sp
import matplotlib.pyplot as plt
import scipy as sp

face = sp.datasets.face(gray=True)
blurred_face = sp.ndimage.gaussian_filter(face, sigma=3)
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_clean_morpho.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

rng = np.random.default_rng(27446968)
n = 10
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_denoising.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
one (with the median filter) and the difference between the two.
"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

rng = np.random.default_rng(27446968)

Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_display_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
An example that displays a raccoon face with matplotlib.
"""

import scipy as sp
import matplotlib.pyplot as plt
import scipy as sp

f = sp.datasets.face(gray=True)

Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Small example to plot a raccoon face.
"""

import scipy as sp
import imageio.v3 as iio
import scipy as sp

f = sp.datasets.face()
iio.imwrite("face.png", f) # uses the Image module (PIL)
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_face_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
This example demoes image denoising on a Raccoon face.
"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

rng = np.random.default_rng(27446968)

Expand Down
3 changes: 1 addition & 2 deletions advanced/image_processing/examples/plot_face_tv_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
This example demoes Total-Variation (TV) denoising on a Raccoon face.
"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

from skimage.restoration import denoise_tv_chambolle

rng = np.random.default_rng(27446968)
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_find_edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
The Sobel filter is one of the simplest way of finding edges.
"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

rng = np.random.default_rng(27446968)

Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_find_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

rng = np.random.default_rng(27446968)
n = 10
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_geom_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
This examples demos some simple geometrical transformations on a Raccoon face.
"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

face = sp.datasets.face(gray=True)
lx, ly = face.shape
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_granulo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
This example performs a simple granulometry analysis.
"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt


def disk_structure(n):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
This example illustrates greyscale mathematical morphology.
"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

im = np.zeros((64, 64))
rng = np.random.default_rng(27446968)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
This example does simple histogram analysis to perform segmentation.
"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

rng = np.random.default_rng(27446968)
n = 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
The example demonstrates image interpolation on a Raccoon face.
"""

import scipy as sp
import matplotlib.pyplot as plt
import scipy as sp

f = sp.datasets.face(gray=True)

Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_measure_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

rng = np.random.default_rng(27446968)
n = 10
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_numpy_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

face = sp.datasets.face(gray=True)
face[10:13, 20:23]
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
This example shows simple operations of mathematical morphology.
"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

square = np.zeros((32, 32))
square[10:-10, 10:-10] = 1
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_radial_mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
This example shows how to do a radial mean with scikit-image.
"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

f = sp.datasets.face(gray=True)
sx, sy = f.shape
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_sharpen.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
applying the filter inverse to the blur.
"""

import scipy as sp
import matplotlib.pyplot as plt
import scipy as sp

f = sp.datasets.face(gray=True).astype(float)
blurred_f = sp.ndimage.gaussian_filter(f, 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
This example uses spectral clustering to do segmentation.
"""

import numpy as np
import matplotlib.pyplot as plt

from sklearn.feature_extraction import image
import numpy as np
from sklearn.cluster import spectral_clustering
from sklearn.feature_extraction import image

################################################################################
l = 100
Expand Down
2 changes: 1 addition & 1 deletion advanced/image_processing/examples/plot_synthetic_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
The example generates and displays simple synthetic data.
"""

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt

rng = np.random.default_rng(27446968)
n = 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
This example shows how to do segmentation with watershed.
"""

import numpy as np
from skimage.segmentation import watershed
from skimage.feature import peak_local_max
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
from skimage.feature import peak_local_max
from skimage.segmentation import watershed

# Generate an initial image with two overlapping circles
x, y = np.indices((80, 80))
Expand Down
1 change: 0 additions & 1 deletion advanced/interfacing_with_c/ctypes/cos_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import ctypes

# find and load the library

# OSX or linux
from ctypes.util import find_library

Expand Down
3 changes: 2 additions & 1 deletion advanced/interfacing_with_c/ctypes_numpy/cos_doubles.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""Example of wrapping a C library function that accepts a C double array as
input using the numpy.ctypeslib."""

from ctypes import c_int

import numpy as np
import numpy.ctypeslib as npct
from ctypes import c_int

# input type for the cos_doubles function
# must be a double array, with single dimension that is contiguous
Expand Down
3 changes: 2 additions & 1 deletion advanced/interfacing_with_c/cython/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from distutils.core import setup, Extension
from distutils.core import Extension, setup

from Cython.Distutils import build_ext

setup(
Expand Down
3 changes: 2 additions & 1 deletion advanced/interfacing_with_c/cython_numpy/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from distutils.core import setup, Extension
from distutils.core import Extension, setup

import numpy
from Cython.Distutils import build_ext

Expand Down
3 changes: 2 additions & 1 deletion advanced/interfacing_with_c/cython_simple/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from distutils.core import setup, Extension
from distutils.core import Extension, setup

from Cython.Distutils import build_ext

setup(
Expand Down
3 changes: 2 additions & 1 deletion advanced/interfacing_with_c/numpy_c_api/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from distutils.core import setup, Extension
from distutils.core import Extension, setup

import numpy

# define the extension module
Expand Down
Loading