Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pratiksha_Waghmare_IP-2021-2022 #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions IP_LP3_ Python_Pratiksha_Waghmare_4756/CSV_to_TSV_.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"import tkinter as tk\n",
"\n",
"root= tk.Tk()\n",
"root.title(\"File Converter\")\n",
"canvas1 = tk.Canvas(root, width = 1500, height = 1000, relief = 'raised')\n",
"canvas1.pack()\n",
"\n",
"label1 = tk.Label(root, text='---FILE CONVERTER----') \n",
"label1.config(font=('Times New Roman', 40))\n",
"canvas1.create_window(750, 110, window=label1)\n",
"\n",
"label6 = tk.Label(root, text='CSV to TSV') \n",
"label6.config(font=('helvetica', 28))\n",
"canvas1.create_window(750, 160, window=label6)\n",
"\n",
"label2 = tk.Label(root, text='Enter input file path to convert:') \n",
"label2.config(font=('helvetica', 20))\n",
"canvas1.create_window(750, 250, window=label2)\n",
"\n",
"entry1 = tk.Entry (root) \n",
"canvas1.create_window(750, 300, window=entry1)\n",
"\n",
"label3 = tk.Label(root, text='\\nEnter Destination path for Output file:(using .tsv extension)') \n",
"label3.config(font=('helvetica', 20))\n",
"canvas1.create_window(750, 400, window=label3)\n",
"\n",
"entry2 = tk.Entry (root) \n",
"canvas1.create_window(750, 470, window=entry2)\n",
"\n",
"def converter (): \n",
" \n",
" x1 = entry1.get()\n",
" x2=entry2.get()\n",
" import csv\n",
" try:\n",
" with open(x1,'r') as csvin, open(x2, 'w') as tsvout:\n",
" csvin = csv.reader(csvin)\n",
" tsvout = csv.writer(tsvout, delimiter='\\t')\n",
"\n",
" for row in csvin:\n",
" tsvout.writerow(row)\n",
" label4 = tk.Label(root, text='File Converted') \n",
" label4.config(font=('Times New Roman', 16))\n",
" canvas1.create_window(750, 700, window=label4)\n",
" except:\n",
" label5 = tk.Label(root, text='Oops!!!Invalid Path,\\nPlease enter correct path') \n",
" label5.config(font=('Times New Roman', 16))\n",
" canvas1.create_window(750, 700, window=label5)\n",
" \n",
" \n",
" \n",
"button1 = tk.Button(text='Convert', command=converter, bg='blue', fg='white', font=('Times New Roman', 16, 'bold'))\n",
"canvas1.create_window(750, 600, window=button1)\n",
"\n",
"root.mainloop()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Binary file not shown.
170 changes: 170 additions & 0 deletions IP_LP3_ Python_Pratiksha_Waghmare_4756/DATA.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
Duration,Pulse,Maxpulse,Calories
60,110,130,409.1
60,117,145,479.0
60,103,135,340.0
45,109,175,282.4
45,117,148,406.0
60,102,127,300.0
60,110,136,374.0
45,104,134,253.3
30,109,133,195.1
60,98,124,269.0
60,103,147,329.3
60,100,120,250.7
60,106,128,345.3
60,104,132,379.3
60,98,123,275.0
60,98,120,215.2
60,100,120,300.0
45,90,112,
60,103,123,323.0
45,97,125,243.0
60,108,131,364.2
45,100,119,282.0
60,130,101,300.0
45,105,132,246.0
60,102,126,334.5
60,100,120,250.0
60,92,118,241.0
60,103,132,
60,100,132,280.0
60,102,129,380.3
60,92,115,243.0
45,90,112,180.1
60,101,124,299.0
60,93,113,223.0
60,107,136,361.0
60,114,140,415.0
60,102,127,300.0
60,100,120,300.0
60,100,120,300.0
45,104,129,266.0
45,90,112,180.1
60,98,126,286.0
60,100,122,329.4
60,111,138,400.0
60,111,131,397.0
60,99,119,273.0
60,109,153,387.6
45,111,136,300.0
45,108,129,298.0
60,111,139,397.6
60,107,136,380.2
80,123,146,643.1
60,106,130,263.0
60,118,151,486.0
30,136,175,238.0
60,121,146,450.7
60,118,121,413.0
45,115,144,305.0
20,153,172,226.4
45,123,152,321.0
210,108,160,1376.0
160,110,137,1034.4
160,109,135,853.0
45,118,141,341.0
20,110,130,131.4
180,90,130,800.4
150,105,135,873.4
150,107,130,816.0
20,106,136,110.4
300,108,143,1500.2
150,97,129,1115.0
60,109,153,387.6
90,100,127,700.0
150,97,127,953.2
45,114,146,304.0
90,98,125,563.2
45,105,134,251.0
45,110,141,300.0
120,100,130,500.4
270,100,131,1729.0
30,159,182,319.2
45,149,169,344.0
30,103,139,151.1
120,100,130,500.0
45,100,120,225.3
30,151,170,300.0
45,102,136,234.0
120,100,157,1000.1
45,129,103,242.0
20,83,107,50.3
180,101,127,600.1
45,107,137,
30,90,107,105.3
15,80,100,50.5
20,150,171,127.4
20,151,168,229.4
30,95,128,128.2
25,152,168,244.2
30,109,131,188.2
90,93,124,604.1
20,95,112,77.7
90,90,110,500.0
90,90,100,500.0
90,90,100,500.4
30,92,108,92.7
30,93,128,124.0
180,90,120,800.3
30,90,120,86.2
90,90,120,500.3
210,137,184,1860.4
60,102,124,325.2
45,107,124,275.0
15,124,139,124.2
45,100,120,225.3
60,108,131,367.6
60,108,151,351.7
60,116,141,443.0
60,97,122,277.4
60,105,125,
60,103,124,332.7
30,112,137,193.9
45,100,120,100.7
60,119,169,336.7
60,107,127,344.9
60,111,151,368.5
60,98,122,271.0
60,97,124,275.3
60,109,127,382.0
90,99,125,466.4
60,114,151,384.0
60,104,134,342.5
60,107,138,357.5
60,103,133,335.0
60,106,132,327.5
60,103,136,339.0
20,136,156,189.0
45,117,143,317.7
45,115,137,318.0
45,113,138,308.0
20,141,162,222.4
60,108,135,390.0
60,97,127,
45,100,120,250.4
45,122,149,335.4
60,136,170,470.2
45,106,126,270.8
60,107,136,400.0
60,112,146,361.9
30,103,127,185.0
60,110,150,409.4
60,106,134,343.0
60,109,129,353.2
60,109,138,374.0
30,150,167,275.8
60,105,128,328.0
60,111,151,368.5
60,97,131,270.4
60,100,120,270.4
60,114,150,382.8
30,80,120,240.9
30,85,120,250.4
45,90,130,260.4
45,95,130,270.0
45,100,140,280.9
60,105,140,290.8
60,110,145,300.0
60,115,145,310.2
75,120,150,320.4
75,125,150,330.4
Loading