Integrating the data in the note book YIPPEEEE
This commit is contained in:
@@ -36,9 +36,9 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import pandas as pd\n",
|
"import pandas as pd\n",
|
||||||
|
"from tkinter.filedialog import askopenfilename\n",
|
||||||
"filename = askopenfilename()\n",
|
"filename = askopenfilename()\n",
|
||||||
"df1= pd.read_csv(filename)\n",
|
"df1= pd.read_csv(filename)"
|
||||||
"from tkinter.filedialog import askopenfilename"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -64,27 +64,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 23,
|
"execution_count": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
" Name\n",
|
|
||||||
"0 Baldur's Gate 3 Early Access \n",
|
|
||||||
"1 Control: Ultimate Edition Cloud Version \n",
|
|
||||||
"2 Doom Eternal: The Ancient Gods Part 1 \n",
|
|
||||||
"3 Watch Dogs: Legion \n",
|
|
||||||
"4 Ring Of Pain \n",
|
|
||||||
"5 Pikmin 3 Deluxe \n",
|
|
||||||
"6 Ghostrunner \n",
|
|
||||||
"7 Disc Room \n",
|
|
||||||
"8 NHL 21 \n",
|
|
||||||
"9 Noita \n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"# CLeaning\n",
|
"# CLeaning\n",
|
||||||
"nuke=df1['GameName'].to_list()\n",
|
"nuke=df1['GameName'].to_list()\n",
|
||||||
@@ -121,7 +103,7 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"# Integrating Game Sales with the previous cleaned data set"
|
"# Integrating Game Datasets together"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -129,7 +111,42 @@
|
|||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": []
|
"source": [
|
||||||
|
"\n",
|
||||||
|
"filename = askopenfilename()\n",
|
||||||
|
"df2 = pd.read_csv(filename)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"# merged = pd.merge(df1,df2, how='inner', sort=True) DOES NOT WORK\n",
|
||||||
|
"# print(merged.head(10))\n",
|
||||||
|
"merged = df2.join(df1, lsuffix='merged') #Good\n",
|
||||||
|
"print(merged.head(10))"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"merged2.to_csv('merged_games.csv')"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"print(df1[['Name']].head(100))\n",
|
||||||
|
"print(df2[['Name']].head(100))"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
|||||||
Reference in New Issue
Block a user