-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathdata_visual.py
46 lines (40 loc) · 1.24 KB
/
data_visual.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
def data_visual():
import pandas as pd
import seaborn as sns
from pandas.plotting import scatter_matrix
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings("ignore")
features = pd.read_csv('features.csv')
labels = pd.read_csv('labels.csv')
names = ['valence', 'arousal', 'dominance', 'liking']
dataset =features.transpose().reindex()
# Summary of dataset
print('Summary of dataset\n')
# shape
print('1. Shape is:')
print(dataset.shape)
# head
print('\n2. First 8 rows are as:')
print(dataset.head(8))
# descriptions
print('\n3. Statistical description:')
print(dataset.describe())
types = dataset.dtypes
print('\n4. Data Types:')
print(types)
# Data visualisation
# box and whisker plots
for i in range(5):
sns.set_style('whitegrid')
sns.boxplot(dataset[i])
plt.title('Magnitude versus ' + str(i+1) + ' channel')
plt.show()
import seaborn as sns
from matplotlib import pyplot as plt
for i in range(5):
sns.distplot(dataset[i])
plt.title('Magnitude versus ' + str(i+1) + ' channel')
plt.show()
if __name__ == '__main__':
data_visual()