Skip to content

Commit d49fea0

Browse files
authored
Changed typing accordingly
1 parent 7c76e5c commit d49fea0

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

machine_learning/dbscan.py

+21-17
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77

88
import math
9-
from typing import dict, list
9+
from typing import Dict, List
1010

1111
import matplotlib.pyplot as plt
1212
import pandas as pd
@@ -39,20 +39,7 @@ def __init__(
3939
self,
4040
minpts: int,
4141
radius: int,
42-
file: str = (
43-
{"x": 3, "y": 7},
44-
{"x": 4, "y": 6},
45-
{"x": 5, "y": 5},
46-
{"x": 6, "y": 4},
47-
{"x": 7, "y": 3},
48-
{"x": 6, "y": 2},
49-
{"x": 7, "y": 2},
50-
{"x": 8, "y": 4},
51-
{"x": 3, "y": 3},
52-
{"x": 2, "y": 6},
53-
{"x": 3, "y": 5},
54-
{"x": 2, "y": 4},
55-
),
42+
file: str = "None",
5643
) -> None:
5744
"""
5845
Constructor
@@ -85,10 +72,27 @@ def __init__(
8572
"""
8673
self.minpts = minpts
8774
self.radius = radius
88-
self.file = file
75+
self.file = (
76+
file
77+
if file != "None"
78+
else (
79+
{"x": 3, "y": 7},
80+
{"x": 4, "y": 6},
81+
{"x": 5, "y": 5},
82+
{"x": 6, "y": 4},
83+
{"x": 7, "y": 3},
84+
{"x": 6, "y": 2},
85+
{"x": 7, "y": 2},
86+
{"x": 8, "y": 4},
87+
{"x": 3, "y": 3},
88+
{"x": 2, "y": 6},
89+
{"x": 3, "y": 5},
90+
{"x": 2, "y": 4},
91+
)
92+
)
8993
self.dict1 = self.perform_dbscan()
9094

91-
def perform_dbscan(self) -> dict[int, list[int]]:
95+
def perform_dbscan(self) -> Dict[int, List[int]]:
9296
"""
9397
Args:
9498
-----------

0 commit comments

Comments
 (0)