Skip to content

Commit

Permalink
python heart classifier samples update pandas (#3019)
Browse files Browse the repository at this point in the history
* samples update

* run black and fix
  • Loading branch information
nemanjarajic authored Feb 26, 2024
1 parent ee242b2 commit d975d59
Showing 1 changed file with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can read this data using pandas library:\n",
"\n",
"> Tip: Notice how the CSV is read as opposite to use directly `pd.read_csv`."
"We can read this CSV file using the `pandas` library:"
]
},
{
Expand All @@ -846,15 +844,11 @@
},
"outputs": [],
"source": [
"from ast import literal_eval\n",
"import pandas as pd\n",
"\n",
"with open(\"named-outputs/score/predictions.csv\", \"r\") as f:\n",
" data = f.read()\n",
" score = pd.DataFrame(\n",
" literal_eval(data.replace(\"\\n\", \",\")), columns=[\"file\", \"prediction\"]\n",
" )\n",
"score"
"score = pd.read_csv(\n",
" \"named-outputs/score/predictions.csv\", names=[\"row\", \"prediction\", \"file\"]\n",
")"
]
},
{
Expand Down Expand Up @@ -1049,9 +1043,9 @@
"name": "python310-sdkv2"
},
"kernelspec": {
"display_name": "previews",
"display_name": "env",
"language": "python",
"name": "previews"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1063,7 +1057,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.10.11"
},
"microsoft": {
"ms_spell_check": {
Expand All @@ -1072,11 +1066,6 @@
},
"nteract": {
"version": "[email protected]"
},
"vscode": {
"interpreter": {
"hash": "8d732042e5e620df2ddb4aad7f460808ed1754fa045785bdb47941e58456b253"
}
}
},
"nbformat": 4,
Expand Down

0 comments on commit d975d59

Please sign in to comment.