Here's the dataset :
1.1;1.2;1.3;2.1;2.2;2.3;2.4;3.1;3.2;3.3;3.4;4.1;4.2;4.3;5.1;5.2
1;1;-;1;1;1;-;1;1;2;-;-;1;-;-;-
6;6;5;6;6;6;6;4;3;2;3;6;0;5;5;2
2;1;1;1;1;2;1;1;1;1;1;1;1;1;1;1
4;1;2;4;1;2;-;2;1;-;1;-;-;1;-;-
1;1;-;1;-;1;-;-;1;-;-;-;-;-;-;-
0;0;0;1;2;0;0;0;0;1;1;0;0;0;0;0
1;1;1;1;0;1;1;1;1;2;1;1;-;-;-;-
0;1;1;1;-;0;-;-;0;-;-;-;-;-;-;-
2;0;-;0;1;-;-;0;1;-;1;-;-;-;-;-
-;1;1;1;-;1;-;-;1;-;-;-;-;1;-;-
2;1;1;1;1;1;1;1;1;-;1;1;-;1;-;-
0;2;-;4;1;1;-;1;0;-;0;-;-;0;-;-
0;-;-;1;1;2;1;-;-;-;-;-;-;-;1;-
1;1;2;1;1;1;1;1;1;2;1;1;1;1;1;1
1;1;1;1;1;1;-;1;1;1;1;1;0;1;-;-
2;1;1;1;1;1;-;1;1;-;1;1;-;-;-;-
3;3;1;0;2;1;0;1;1;0;0;1;0;1;1;0
3;4;-;2;1;-;-;1;1;-;1;1;-;-;-;-
4;1;1;1;3;2;3;1;1;2;1;1;2;0;4;4
Here's the code:
import csv
import glob
import re
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
files = glob.glob(f"session*C.csv")
# load dataset with pandas
df = pd.read_csv(files[0], sep = ';')
# replace "-" data with 0
dfs = df.replace(r'^-$', 0, regex=True)
print(dfs)
# Seaborn boxplot
sns.set_style('darkgrid')
fig, ax = plt.subplots(figsize=(9, 10))
sns.boxplot(data=dfs, orient="h", ax=ax)
plt.show()
Two weird bugs here:
- Boxplot only outputs column 2.1.
- Dataframes
df
anddfs
exhibit a weird one-space column before column 2.1, the one that gets plotted!
The code works perfectly fine with other datasets. I searched and tested things for hours.