Skip to content

Commit

Permalink
alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
egorpol committed Sep 20, 2023
1 parent c6af227 commit 6947edc
Show file tree
Hide file tree
Showing 25 changed files with 1,529,402 additions and 20,184 deletions.
25 changes: 15 additions & 10 deletions 2df_copypaste.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 7,
"id": "890d21fc",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -133,7 +133,7 @@
"\n",
"#load data from TSV\n",
"\n",
"df = pd.read_csv('parm.tsv', delimiter='\\t')\n",
"df = pd.read_csv('tsv/parm.tsv', delimiter='\\t')\n",
"\n",
"display(df)"
]
Expand Down Expand Up @@ -540,30 +540,35 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 8,
"id": "d57cf741",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data saved successfully to C:\\Users\\egor_\\Desktop\\tests\\audiospylt\\parm_double1.tsv at 2023-09-19 15:10:02.614358.\n"
"Data saved successfully to C:\\Users\\egor_\\Desktop\\tests\\audiospylt\\tsv\\parm_double2.tsv at 2023-09-20 11:31:01.662101.\n"
]
}
],
"source": [
"import os\n",
"from datetime import datetime\n",
"\n",
"# Define the DataFrame to be saved\n",
"df_to_save = new_df\n",
"# Define the path for the /tsv subfolder\n",
"output_directory = 'tsv'\n",
"\n",
"# Check if the directory exists; if not, create it\n",
"if not os.path.exists(output_directory):\n",
" os.makedirs(output_directory)\n",
"\n",
"# Define the filename path to save inside the /tsv subfolder\n",
"filename = os.path.join(output_directory, 'parm_double2.tsv')\n",
"\n",
"# save the DataFrame as a TSV file\n",
"filename = 'parm_double1.tsv'\n",
"try:\n",
" df_to_save.to_csv(filename, sep='\\t', index=False)\n",
" print(f\"Data saved successfully to {os.getcwd()}\\\\{filename} at {datetime.now()}.\")\n",
" new_df.to_csv(filename, sep='\\t', index=False)\n",
" print(f\"Data saved successfully to {os.path.abspath(filename)} at {datetime.now()}.\")\n",
"except:\n",
" print(\"Error: data could not be saved.\")\n"
]
Expand Down
Loading

0 comments on commit 6947edc

Please sign in to comment.