I have this code and i want to merge results of v in finding_rating function into one list. The type of result coming from v is <class 'numpy.float64'>.
from pandas import DataFrame
import pandas as pd
import numpy as np
from itertools import chain
negative_counter = []
positive_counter = []
df = pd.DataFrame({'userId': [10,20,10,20,10,20,60,90,60,90,60,90,30,40,30,40,30,40,50,60,50,60,50,60],
                   'movieId': [500,500,800,800,700,700,1100,1100,1900,1900,2000,2000,1600,1600,1901,1901,3000,3000,3025,3025,4000,4000,500,500],  
                   'ratings': [3.5,4.5,2.0,5.0,4.0,1.5,3.5,4.5,3.5,4.5,2.0,5.0,4.0,1.5,3.5,4.5,3.5,4.5,2.0,5.0,4.0,1.5,3.5,4.5]})
counter = [] 
numberOfUsers = 2
numberOfMovies = 3
usersLength = numberOfUsers*numberOfMovies
total_length = 6 
def grouping_data(df):
    # df_new = pd.DataFrame(columns=['genres','movieId','rating','timestamp', 'title', 'userId', 'year'])
    data = df[df.index % total_length < usersLength]
    return data
# grouping_data(df)
def chunker(seq, size):
    return (seq[pos:pos + size] for pos in range(0, len(seq), size))
def finding_rating(data):
     for chunk in chunker(data,usersLength):
        r = chunk.pivot(index="movieId",columns="userId")
        r.columns = ["u1","u2"]                                                                                                
        r["drate"] = r.u1.sub(r.u2).abs()
        v = r.drate.iloc[:-1].mean()-r.drate.iloc[-1]
        print(type(v))
data1 = grouping_data(df)
data2 = finding_rating(data1)
 
    