Python: Pandas Lesson 7
Learning : Create simple zoo application P1
Subject: The Menu and functions names
Althought we mostly using pandas in reading datafile and analysing it, Here we are thinking as if we have an interface for an application, and we are offering some menu and function to the user so he can use the apps.
As we went throught learnning pandas and from all past lessons we saw alot’s of functions and commands that are enuph to start developing a small application to manage our zoo data. Starting from this post we will bulid parts of our application, so lets start.
The Menu The menu is the way or the tool that will help the user to perform deffernt action on the data. Here is the function of the the_menu and it will return the user selection.
Althought we mostly using pandas in reading datafile and analysing it, but Here we are think as if we have an interface of application, and the we are offering a menu to the user were he can select a function user will
The Menu
def the_menu ():
print(‘\n ::—–{ The menu }—-::’)
print(‘1. Load New csv File’)
print(‘2. Show Sample Data’)
print(‘3. Show Columns’)
print(‘4. Data Type’)
print(‘5. Sort.’)
print(‘6. Missing Data’)
print(‘7. Add New Record.’)
print(‘8. Edit a record.’)
print(‘9. Delete a Record.’)
print(’10. Save the File.’)
return (input(‘\n Enter your selection: ‘))
# calling the menu.the_menu()
![]() |
def the_menu(): The code above will print our menu on the screen and asking the user to select the action and return a number of the menu. From there we will run other functions, we may change or add to the menu if we need to.
First I will define each menu-line to have an overall view of the functionality in the app:
1. Load New csv File: We will ask the user to write the file name he want to upload, and we will assume that the file is in the same directory and if the file not exist we will create one.
2. Show Sample Data: Print out sample data from the dataframe using df.sampl().
3. Show Columns: List all the columns in the dataframe.
4. Data Type: Show the data Type of each column.
5. Sort: The user will select the sorting column.
6. Missing Data: This command will give the user a report of how many data are available in the columns and if there is any missing data.
7. Add New Record: Adding new row to the data file.
8. Edit a record: Editing a row.
9. Delete a Record: Deleting a row from the data file.
10. Save the File To save the file, and we will save it under new name.
Whats in the next lesson:
:: Writing the menu selection loops.
:: Writing the first two functions in the application.
:: Pandas Lessons Post ::
Lesson 1 | Lesson 2 | Lesson 3 | Lesson 4 |
Lesson 5 | Lesson 6 | Lesson 7 | Lesson 8 |
Lesson 9 | Lesson 10 | Lesson 11 | Lesson 12 |
-
August 6, 2019 at 8:41 amPython: Pandas Lesson 6 | Ali's Photography Space...
-
August 9, 2019 at 7:08 pmPython: Pandas Lesson 8 | Ali's Photography Space...
-
August 11, 2019 at 8:35 amPython: Pandas Lesson 9 | Ali's Photography Space...
-
August 13, 2019 at 8:36 amPython: Pandas Lesson 10 | Ali's Photography Space...
-
August 15, 2019 at 8:34 amPython: Pandas Lesson 11 | Ali's Photography Space...
-
August 18, 2019 at 8:41 amPython: Pandas Lesson 12 | Ali's Photography Space...
-
August 20, 2019 at 8:37 amPython: Orders Manager P1 | Ali's Photography Space...
-
August 25, 2019 at 9:22 amlearning – Temp | Ali's Photography Space...