Пример #1
0
        font=dict(
            family="Courier New, monospace",
            size=8,
            color="#7f7f7f"
        )
    )
    fig.update_xaxes(title_text="Scores", row=row, col=column)
    fig.update_yaxes(title_text="Frequency", row=row, col=column)

    # Overlay both histograms
    fig.update_layout(barmode='overlay')
    # Reduce opacity to see both histograms
    fig.update_traces(opacity=0.75)
    
if __name__ == "__main__":
    df =  readData(sys.argv)
    df_numerical = describe(df)
    titles = tuple(df_numerical.columns)
    fig = make_subplots(
        rows=ROWS, cols=COLUMNS,
        subplot_titles=titles,
        specs=[
                # row 1 
                [{"secondary_y": True}, {"secondary_y": True}, {"secondary_y": True}, {"secondary_y": True},{"secondary_y": True} ],
                # row 2 
                [{"secondary_y": True}, {"secondary_y": True}, {"secondary_y": True}, {"secondary_y": True},{"secondary_y": True} ],
                # row 3 
                [{"secondary_y": True}, {"secondary_y": True}, {"secondary_y": True}, {"secondary_y": True},{"secondary_y": True} ]   
            ])
    r = 1
    index = 0
from Queue import Queue
import os, sys
currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(currentdir)
sys.path.append(parentdir)

from helpers import readData

from env import env

if __name__ == "__main__":

    airbnbList = readData(env['path_airbnb'])

    myQueue = Queue()
    for i in range(myQueue.limit):
        myQueue.insert(airbnbList[i])

    myQueue.show()
    #myQueue.remove()
    print(
        "##############################################################################################################################"
    )
    myQueue.tam()
    myQueue.remove()
    print(
        "##############################################################################################################################"
    )
    myQueue.insert(airbnbList[0])
    myQueue.show()
Пример #3
0
    for i in clusters:
        plt.plot(i.x(), i.y(), 'bo')

    plt.show()


def iterateClusters(vectors, clusters, old=[]):
    new = assignCluster(vectors, clusters)
    iterateClusters(vectors, new, clusters)


if __name__ == "__main__":
    vectors = []
    clusters = []
    k = 7  # Number of clusters
    data = helpers.readData('data_1024.csv', '\t')

    for coord in zip(data['Distance_Feature'], data['Speeding_Feature']):
        vector = models.Point(coord, None)
        vectors.append(vector)

    clusters = generateClusters(vectors, k)

    coordList = [
    ]  # Used for detecting duplicates, once a duplicate is shown the loop will break.

    while True:
        clusters = assignCluster(vectors, clusters)

        for y in clusters:
            coordList.append(y.coordinates)