-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4_Examples_Categories.py
44 lines (29 loc) · 1.01 KB
/
4_Examples_Categories.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
# Pandas
import pandas as pd
import numpy as np
# Seagull
from src.Seagull.Seagull import Seagull
def main():
# Load the Iris dataset
irisDF = Seagull()
irisDF.set_iris()
print(irisDF.describe_types())
my_categories = irisDF.get_categories(4)
print(my_categories)
# Load the Spotify dataset
spotify_instances = Seagull.get_spotify_datasets()
spotify_ArtitstDF = spotify_instances[0]
spotify_SongsDF = spotify_instances[1]
spotify_ComposersDF = spotify_instances[2]
# Show the categories of the column 16 (Key)
my_categories = spotify_SongsDF.get_categories(16)
print(my_categories)
# Change the NA categorical values to "Not-Defined"
spotify_SongsDF.swap_NA_category(16, "Not-Defined")
# Show the summary of the categorical column 16 (Key)
my_summary = spotify_SongsDF.summarize_categorical_column(16)
print(my_summary)
my_summary = irisDF.summarize_categorical_column(4)
print(my_summary)
if __name__ == "__main__":
main()