Q:

Probability distributions and float variables, probability must add to 1

I'm working on a script which goes like this: the program analyses a bunch of text documents in a certain language, draws the probability distributions for each k, where k is the first character appearing after each given letter of the alphabet in each word of the text.  Then the program uses this knowledge to try and write "real" words using Markov Chains. 
I have already written most of the script, and it is already spitting out interesting words, the point is that the function which generates words is working with a try and except mechanism to avoid getting stuck.  It gets stuck because some probability distributions DO NOT add to 1 (I guess becuase the float type is not that precise or something like that) and the numpy functions which should work with these distributions raises a ValueError because of the probabilities not adding up to 1.  
By triggering the exception for some distributions, some words are not generated at all and the final result is less interesting than what it might be. 
Now, my question is: is there a way to make these probability distributions add up to 1 when they are generated? 
I've tried gmpy2, the round() function but no one seems to work.  Maybe this is a silly question and I just need to get some fresh air... Anyway, some help would be useful! 
here is the code for the generation of the probability distribution
def FreqRel(self,listValues):
    absFreq = self. AbsFreq(listValues)
    freqRel = []
    for i in absFreq:
        freqRel.append(i/sum(absFreq))
    if sum(freqRel) ! = 1:
        print("Frequencies do not add up to 1")
        if sum(freqRel) - 1 < 0:
            diff = sum(freqRel) - 1
            #This should be an adjustment which should not interfere
            #that much on the probability distribution
            freqRel[1] = freqRel[1] - diff
            print("missing",diff)
        elif sum(freqRel) - 1 > 0:
            diff = sum(freqRel) - 1
            #This should be an adjustment which should not interfere
            #that much on the probability distribution
            freqRel[1] = freqRel[1] - diff
            print("Too much",diff)
    return freqRel

Here is what I get printed on the console when running this function:

Here is the code that crashes when the sum is not 1.  The numpy lines are thos which crash. 
and the error is: ValueError: probabilities do not add up to 1. 
def spitText(n):
    i = 0
    while i < n:
        try:
            word = ""
            #This oldChar setting is arbitrary, later I'm going to fix it
            oldChar = "b"
            for k in range(np.random.choice(distributions[0],replace=True,p=distributions[1])):
                newChar = np.random.choice(alphabet,replace=True,p=distRel[alphabet.index(oldChar)])
                word = word + newChar
                oldChar = newChar
            print(word)
            time.sleep(0.2)
            i+=1
        except:
            pass

A:

You have some output that looks like this:
1.0
1.0
1.0
0
1.0
1.0

From a comment:

that's a simple for loop outside this function that prints out the sum of each distribution stored as a returned value from this function

So, some of your frequency distributions sum to 0.  That's your problem.  
Presumably your code that builds the distributions have some edge case that either returns an empty distribution, or one that's all zeros.  Either way, it's obviously not going to work. 

The fact that many of those 1.0 values are off by a cumulative rounding error of as much as 8e-17 is a red herring.  You can see that numpy is built to handle those:
>>> np.random.choice(2, 3, p=[0.4, 0.6+3e-17])
array([1, 0, 0])

It's only when the error gets large enough (the default relative epsilon for most of numpy is 1e-5) that it complains:
>>> np.random.choice(2, 3, p=[0.4, 0.6+3e-5])
ValueError: probabilities do not sum to 1

So you must have some probability distributions whose sums are off of 1 by more than 1e-5.  And of course you do; you have some that are off by a whole 1. 

This means your main question:

is there a way to make these probability distributions add up to 1 when they are generated? 

… is really an XY problem: it's not the thing you need to solve here. 
But I'll answer it anyway.  The short answer is: No.  Floats are binary fractions with a fixed number of digits of precision.  If you try to store arbitrary real numbers in floats, you will get rounding errors.  You can see this pretty easily:
>>> 1.0 + 1e-17
1.0

There just aren't enough bits to store 1.0 and 1.00000000000000001 as different binary fractions. 
If you want to understand further (and you should), read What every computer scientist should know about floating point, the classic introductory paper on the topic.