Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Mapreduce easy and simple

  • 08-01-2015 5:39pm
    #1
    Closed Accounts Posts: 1,040 ✭✭✭


    Hi, I need a quick and easy to use Mapreduce program in python or R, asap, PLEASE!

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 7,157 ✭✭✭srsly78


    What does it say when you type "mapreduce python example" into google? I can't be bothered to check, can you do it for me please?


  • Registered Users, Registered Users 2 Posts: 2,386 ✭✭✭RebelButtMunch


    Isn't it the zoom out button on the side of the map?


  • Closed Accounts Posts: 1,040 ✭✭✭Scrappychimow


    i did check, i am looking for the easiest to use. i am new to mapreduce ok?


  • Registered Users, Registered Users 2 Posts: 7,157 ✭✭✭srsly78


    Google for "mapreduce python simple example". The 4th result down looks promising.


  • Closed Accounts Posts: 1,040 ✭✭✭Scrappychimow


    Hi i am using citirix connection on my mac and i have python 2.7 idle.

    I want to run a mapreduce program using octo.py (mapreduce)

    after importing sys,octo

    i have started the program with:


    text_files = glob.glob('C:\Users\mm\Desktop\datab/txt*')

    def file_contents(file_name):
    f = open(file_name)
    try:
    return f.read()
    finally:
    f.close()

    source = dict((file_name, file_contents(file_name))
    for file_name in text_files)
    def mapfn(key, value):
    for line in value.splitlines():
    for word in line.split():
    yield word.lower(), 1

    def reducefn(key, value):
    return key, len(value)

    def final(key, value):
    print key, value

    But nothing comes up in the shell when i run the program?

    Please help someone


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 7,157 ✭✭✭srsly78


    Run a simple "hello world" program first to make sure environment is setup.


  • Closed Accounts Posts: 1,040 ✭✭✭Scrappychimow


    srsly78 wrote: »
    Run a simple "hello world" program first to make sure environment is setup.

    yes it is


  • Registered Users, Registered Users 2 Posts: 7,157 ✭✭✭srsly78


    Step through the code with breakpoints and see where it is failing.


  • Closed Accounts Posts: 1,040 ✭✭✭Scrappychimow


    It doesn't say any syntax or error at all- the output is just >>> and blank for each part


  • Registered Users, Registered Users 2 Posts: 7,157 ✭✭✭srsly78


    Debug the program, make sure it is actually reading the input first. Refer to documentation to find out how to use breakpoints etc. Make sure all the basic stuff is working before you even worry about the complicated bits.

    Seems you are confusing windows with mac filename conventions, check this.


  • Advertisement
  • Closed Accounts Posts: 1,040 ✭✭✭Scrappychimow


    Thanks but i am a novice with programming, i thought i could get some help here for someone underpressure.


Advertisement