Skip to content

Commit 66e99cf

Browse files
committed
Update Analysis-1.md
1 parent 5c42904 commit 66e99cf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/_analysis/Analysis-1.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,25 @@ To clean this data, we will use Riot's static JSON data source (Data Dragon) to
4141

4242
![flatten](/assets/images/tft1/flatten.png)
4343

44+
<pre> '''#units
45+
with open("tft-champion-minus.json") as json_file:
46+
json_data = json.load(json_file)
47+
48+
df_unit = pd.DataFrame([
49+
[value["id"], value["name"]] for value in json_data.values()
50+
],columns=["id","name"])''' </pre>
51+
4452

4553
After exporting these as csv files, we imported them into MySQL for querying to merge and clean the tables.
4654

55+
<pre> ```select * from df_augments; ``` </pre>
56+
4757
![uncleaned](/assets/images/tft1/uncleaned.png)
4858

59+
<pre> ```### Cleaned Augments
60+
select match_number, participant_placement, name, CASE WHEN da.participant_placement = 1 THEN 1 ELSE 0 END as First
61+
from df_augments da left join df_augment_static das on da.participant_augments = das.id;``` </pre>
62+
4963
![cleaned](/assets/images/tft1/cleaned.png)
5064

5165
## Data Querying

0 commit comments

Comments
 (0)