Join the Stack Overflow Community
Stack Overflow is a community of 6.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up
import os
import sys
import numpy as np
import scipy
import pylab
import pymorph
import mahotas
import matplotlib.pyplot as plt
import Image

from scipy import ndimage
from pymorph import regmax
from PIL import Image




path='all_images'


for file in os.listdir(path):
    current = os.path.join(path, file)
    extension = os.path.splitext(current)[-1]
    fileType = extension.upper()
    print(current)

    if os.path.isfile(current):
        img = mahotas.imread(current)
        imgf = ndimage.gaussian_filter(img, 8)
        pylab.gray()
        imgf.save('dnaa.gif')

Can not save file using the below python code. Error: numpy.ndarray object has no attribute 'save'. Can anyone help how to save file using pylab. I guss the last line of the code has some issue.

share|improve this question
    
In the future it is better to include the full trace back. – tacaswell Nov 29 '13 at 6:33

Use mahotas.imsave('dnaa.gif', imgf) instead. The NumPy array you get from gaussian_filter doesn't have save functionality built in.

share|improve this answer
    
Thank you very much. – Russel Nov 29 '13 at 0:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.