Table Editor in Python with pandastable
Key Takeaways
The video demonstrates how to build a simple table editor in Python using the pandastable package, which provides a graphical user interface for editing tables, similar to a minimalistic Excel clone. The package is used in conjunction with the Tkinter library for creating the GUI.
Full Transcript
what is going on guys welcome back in this video today we're going to learn how to easily build a simple table editor in Python with a graphical user interface almost like a minimalistic Excel clone using a package called Panda table so let us get right into [Music] it all right so this is really going to be a super simple tutorial in this video today we're going to work with an external python package called Panda tape and it's going to allow us to easily build a simple table editor with a graphical user interface in Python now the idea is we're going to build our graphical user interface with TK inter the core python package and then this pandas table package introduces a new component or a new widget you could say to the GUI called the table and it works basically like a very very minimalistic version of excel so we have the ability to add rows to change the content of files to Import and Export uh to filter to Aggregate and to sort and so on so it's a very minimalistic version of a uh sheet application you could say even though it doesn't have nearly as much functionality but it's a very easy way to do that and you don't really have to do much coding you just have to add the component to your application which is why I say it's going to be a very simple video so what we're going to do is we're going to open up our command line and we're going to install the packages that we need uh so we're going to use pip or pip 3 and install and then obviously pandas if you don't have it on your system yet and second pandas table the package that is going to give us this uh widget now what we're going to do in our code is we're going to say import TK inter s TK this is core python then import pandas aspd and from pandas table we want to import the table now we're going to model our application as a class I'm going to call this your table editor and we're going to provide a simple init method here we're going to define a root element so the root is going to be a TK instance we're going to set a title let's call this just table editor and now what we need to do is we need to add to this root window a frame and into this Frame we need to add the table we cannot add the table directly into the window we need to First create a frame so we're going to say self. frame is equal to TK frame part of self. root then self. frame is going to be packed and then we're going to say self. table is equal to table and here now we can provide a couple of things now first of all of course it's part of the frame but then we can also provide a default um a default data frame so we can say that the data frame is some data frame or we can just leave it as none so this is also possible we can just create the table I can say self table show and then self. root main Loop to run the application then I can go down here and say if uncore name uncore uncore equals then main if that's the case create an instance of table editor and this will already result in our application uh showing this table editor tool here however you can see we cannot really do a lot we don't have any data in here we don't have any buttons that we can work with so what we can do right away is we can go ahead and we can say that we want to enable two things we want to show the status bar so show status bar true and we want to show the toolbar which has all the functionality so I can run this and now you can see we don't have any data yet but we still have or we already have uh buttons here load a table we can save we can import CSV we can load an Excel file we can copy the table to clipboard we can paste the table we can do um operations like transposing aggregating and so on we can merge concatenate join we can filter we can do calculations we can fit models uh we can do a lot of things visually here just by adding the pandis table component now what we can do is we can define a sample data frame up here let's call this sample DF it's going to be a PD data frame uh let's just add some data here column one we'll have the values 1 2 3 then [Music] maybe column 2 column 3 let's use here A B C and then down here maybe something like four five six so now I can set this as the default data frame I can say data frame equals and then sample DF and then you can see we have the data here and now of course I can change it I can change this to six for example probably I have to press enter uh and then I can save this for example I can say save I can navigate to my documents directory where is it I have a lot of hidden directories here documents programming neural 9 python current and here of course I can save it as a pickle file but I can also go to all files and I can say data. CSV and this will automatically SA sa it as a CSV file as you can see here and um it will also save the six not the five so it saved the edited version and this is just a simple example right I can do a lot of more things I can add rows um I can I can change values I can uh transpose there you go I can transpose the whole uh data frame I can aggregate uh on different columns with different functions here uh I don't want to go through all the features but basically you you have this sort of minimalistic I don't like to call it actually Excel clone because you don't have these uh operations I think you cannot do stuff like equals and then some formula but you do have basic table editing and basic sheet manipulation functionality here uh let me see where where was the possibility to plot I can oh actually opened it on my second screen so I plotted 466 and you can see now here column 3 and then it plotted this um maybe I can also do it like this plot select it opens it up here again no actually now it doesn't show it on the x-axis uh but we have a bunch of different uh options here for styling and animation this is basically pandas in a graphical user interface and you can just add it to your application easily and build a simple table editor for yourself using this Panda table package so that's it for today's video I hope you enjoyed it and hope you learned something if so let me know by hitting a like button and leaving a comment in the comment section down below and of course don't forget subscribe to this Channel and hit the notification Bell to not miss a single future video for free other than that thank you much for watching see you in the next video and bye
Original Description
Today we learn how to easily build a simple table editor in Python using the pandastable package.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: https://www.neuralnine.com/books/
💻 The Algorithm Bible Book: https://www.neuralnine.com/books/
👕 Programming Merch: https://www.neuralnine.com/shop
💼 Services 💼
💻 Freelancing & Tutoring: https://www.neuralnine.com/services
🌐 Social Media & Contact 🌐
📱 Website: https://www.neuralnine.com/
📷 Instagram: https://www.instagram.com/neuralnine
🐦 Twitter: https://twitter.com/neuralnine
🤵 LinkedIn: https://www.linkedin.com/company/neuralnine/
📁 GitHub: https://github.com/NeuralNine
🎙 Discord: https://discord.gg/JU4xr8U3dm
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from NeuralNine · NeuralNine · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Visualizing Stock Data With Candlestick Charts in Python
NeuralNine
Python Beginner Tutorial #1 - Installation and First Program
NeuralNine
Python Beginner Tutorial #2 - Variables and Data Types
NeuralNine
Python Beginner Tutorial #3 - Operators and User Input
NeuralNine
Python Beginner Tutorial #4 - If Statements and Conditions
NeuralNine
Python Beginner Tutorial #5 - Loops
NeuralNine
Python Beginner Tutorial #6 - Sequences and Collections
NeuralNine
Python Beginner Tutorial #7 - Functions
NeuralNine
Python Beginner Tutorial #8 - Exception Handling
NeuralNine
Python Beginner Tutorial #9 - File Operations
NeuralNine
Python Beginner Tutorial #10 - String Functions
NeuralNine
Python Intermediate Tutorial #1 - Classes and Objects
NeuralNine
Python Intermediate Tutorial #2 - Inheritance
NeuralNine
Python Intermediate Tutorial #3 - Multithreading
NeuralNine
Python Intermediate Tutorial #4 - Synchronizing Threads
NeuralNine
Python Intermediate Tutorial #5 - Events and Daemon Threads
NeuralNine
Python Intermediate Tutorial #6 - Queues
NeuralNine
Python Intermediate Tutorial #7 - Sockets and Network Programming
NeuralNine
Python Intermediate Tutorial #8 - Database Programming
NeuralNine
Python Intermediate Tutorial #9 - Recursion
NeuralNine
Python Intermediate Tutorial #10 - XML Processing
NeuralNine
Python Intermediate Tutorial #11 - Logging
NeuralNine
Python Data Science Tutorial #1 - Anaconda and PyCharm Setup
NeuralNine
Python Data Science Tutorial #2 - NumPy Arrays
NeuralNine
Python Data Science Tutorial #3 - Numpy Functions
NeuralNine
Python Data Science Tutorial #4 - Plotting Functions With Matplotlib
NeuralNine
Python Data Science Tutorial #5 - Subplots and Multiple Windows
NeuralNine
Python Data Science Tutorial #6 - Matplotlib Styling
NeuralNine
Python Data Science Tutorial #7 - Bar Charts with Matplotlib
NeuralNine
Python Data Science Tutorial #8 - Pie Charts with Matplotlib
NeuralNine
Python Data Science Tutorial #9 - Plotting Histograms with Matplotlib
NeuralNine
Python Data Science Tutorial #10 - Scatter Plots with Matplotlib
NeuralNine
Python Data Science Tutorial #11 - 3D Plotting with Matplotlib
NeuralNine
Python Data Science Tutorial #12 - Pandas Series
NeuralNine
Python Data Science Tutorial #13 - Pandas Data Frames
NeuralNine
Python Data Science Tutorial #14 - Pandas Statistics
NeuralNine
Python Data Science Tutorial #15 - Pandas Sorting and Functions
NeuralNine
Python Data Science Tutorial #16 - Pandas Merging Data Frames
NeuralNine
Python Data Science Tutorial #17 - Pandas Queries
NeuralNine
Python Machine Learning Tutorial #1 - What is Machine Learning?
NeuralNine
Python Machine Learning Tutorial #2 - Linear Regression
NeuralNine
Python Machine Learning Tutorial #3 - K-Nearest Neighbors Classification
NeuralNine
Python Machine Learning #4 - Support Vector Machines
NeuralNine
Python Machine Learning Tutorial #5 - Decision Trees and Random Forest Classification
NeuralNine
Python Machine Learning Tutorial #6 - K-Means Clustering
NeuralNine
Python Machine Learning Tutorial #7 - Neural Networks
NeuralNine
Python Machine Learning Tutorial #8 - Handwritten Digit Recognition with Tensorflow
NeuralNine
Generating Poetic Texts with Recurrent Neural Networks in Python
NeuralNine
Stock Portfolio Visualization with Matplotlib in Python
NeuralNine
Analyzing Coronavirus with Python (COVID-19)
NeuralNine
Making Text Images Readable Again with Python and OpenCV
NeuralNine
Neural Networks Simply Explained (Theory)
NeuralNine
Motion Filtering with OpenCV in Python
NeuralNine
Top 5 Programming Languages To Learn in 2020
NeuralNine
Simple TCP Chat Room in Python
NeuralNine
Image Classification with Neural Networks in Python
NeuralNine
Edge Detection with OpenCV in Python
NeuralNine
S&P 500 Web Scraping with Python
NeuralNine
Simple Sentiment Text Analysis in Python
NeuralNine
Introduction - Algorithms & Data Structures #1
NeuralNine
More on: AI Pair Programming
View skill →Related Reads
🎓
Tutor Explanation
DeepCamp AI