How to build a multidimensional data point in python

Suppose some prerequisites:

I want to talk about the Mel Frequency of the Cepstral Coefficients of various songs and compare them. I calculate MFCC throughout the song and then average them to get one array of 13 coefficients. I want this to represent one point on the graph that I am drawing.

I am new to Python and very new to any form of conspiracy (although I saw some guidelines for using matplotlib).

I want to be able to visualize this data. Any thoughts on how I can do this?

+8
source share
1 answer

-, 13 , 13 , . 2 , // /...., , PCA. , - .

, : http://matplotlib.org/api/pyplot_api.html

:

import matplotlib.pyplot as plt
import numpy as np

#fake example data
song1 = np.asarray([1, 2, 3, 4, 5, 6, 2, 35, 4, 1])
song2 = song1*2
song3 = song1*1.5

#list of arrays containing all data
data = [song1, song2, song3]

#calculate 2d indicators
def indic(data):
    #alternatively you can calulate any other indicators
    max = np.max(data, axis=1)
    min = np.min(data, axis=1)
    return max, min

x,y = indic(data)
plt.scatter(x, y, marker='x')
plt.show()

: enter image description here

, , : . - parralel, :

import pandas as pd
pd.DataFrame(data).T.plot()
plt.show()

x y. : enter image description here

:

Python, :

enter image description here

enter image description here

+6

All Articles