├── .gitattributes ├── README.md ├── novatechtask2.py └── novatechtask1.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 📊 Data Analytics & 📓 Notes Application 3 | 4 | Task 01: Basic Data Analytics Operations 5 | 📄 Description 6 | Perform basic data analytics operations like mean, median, and mode using the `pandas` module. 7 | 8 | 🔧 Operations 9 | With the help of the `pandas` module, I read a CSV file as a dataset and performed basic data analytics 10 | operations. 11 | 12 | 🛠️ Functions Used in Pandas 13 | 👉🏻 `read_csv()` 📥: To read the CSV file dataset. 14 | 👉🏻 `head()` 👀: To return the first five records in the dataset. 15 | 👉🏻 `tail()` 🔍: To return the last five records in the dataset. 16 | 👉🏻 `mean()` ➗: To return the mean value of the specified column. 17 | 👉🏻 `median()` 🔸: To return the median value of the specified column. 18 | 👉🏻 `mode()` 🔢: To return the mode value of the specified column. 19 | 👉🏻 `describe()` 📊: To return basic analysis of the dataset like min value, max value, standard deviation, and more. 20 | 👉🏻 `columns()` 🏷️: To return the column names of the dataset. 21 | 22 | 📝 Data Manipulation 23 | Using these functions in the `pandas` module, I manipulated the data. The dataset used was sourced from Kaggle. 24 | 25 | 26 | Task 02: Command Line Notes Application 27 | 28 | 📄 Description 29 | Create a Command Line-based notes application. 30 | 31 | 🎨 UI Creation with Streamlit 32 | Using the `streamlit` module, I created interactive widgets to enhance the application. 33 | 34 | 🛠️ Functions Used in Streamlit 35 | 👉🏻 `sidebar()` 🗂️: Used to create a sidebar widget. 36 | 👉🏻 `selectbox()` 🔘: Used to choose options from a selection box widget. 37 | 👉🏻 `title()` 🏷️: Used to give a title to the application. 38 | 👉🏻 `text_input()` ⌨️: Used to create a textbox. 39 | 👉🏻 `success()` ✅: Used to return a success message. 40 | 👉🏻 `button()` 🔲: Used to create button widgets. 41 | 42 | ✔️ Completion 43 | With the help of these functions, I successfully completed both tasks.😊 44 | -------------------------------------------------------------------------------- /novatechtask2.py: -------------------------------------------------------------------------------- 1 | import streamlit as st # importing section 2 | import json # importing section 3 | 4 | def load_notes(): 5 | try: # try block 6 | with open("notes.json", "r") as file: # opening a file with read mode 7 | return json.load(file) # load the file 8 | except FileNotFoundError: # expect block for filenot found exception 9 | return {} 10 | 11 | def save_notes(notes): # save note function 12 | with open("notes.json", "w") as file: # open the file with write mode 13 | json.dump(notes, file) 14 | 15 | def add_note(title, content): # add notes function 16 | notes = load_notes() # call the load function 17 | notes[title] = content # store the content with respective to their title 18 | save_notes(notes) # call the save function 19 | st.success("Note added successfully!") # success message. 20 | 21 | def list_notes(): # list note function 22 | notes = load_notes() # call the load_notes function 23 | if notes: 24 | st.write("## Notes:") # write function to write Notes 25 | for title in notes: 26 | st.write("-", title) # Iterate each and every notes saved and print them. 27 | else: 28 | st.write("No notes found.") 29 | 30 | def view_note(title): 31 | notes = load_notes() # call the load_notes function 32 | if title in notes: 33 | st.write("## Title:", title) # write funtion to write title 34 | st.write("## Content:", notes[title]) 35 | else: 36 | st.error("Note not found.") 37 | 38 | def delete_note(title): 39 | notes = load_notes() # call the load_notes function 40 | if title in notes: 41 | del notes[title] # del is used to delete the notes. 42 | save_notes(notes) # call the save_notes function. 43 | st.success("Note deleted successfully!") # success message. 44 | else: 45 | st.error("Note not found.") # error message 46 | 47 | 48 | st.title("Command-line Note-taking App") # main title of the application 49 | menu_option = st.sidebar.selectbox("Menu", ["Add Note", "List Notes", "View Note", "Delete Note"]) # sidebar widget with add note, List note, View Note and Delete Note options. 50 | if menu_option == "Add Note": # option 01 51 | st.header("Add a New Note") # heading1 h1 of the application 52 | title = st.text_input("Enter the title of the note:") # textbox widget. 53 | content = st.text_area("Enter the content of the note:") # tedtbox widget area. 54 | if st.button("Add Note"): # button 01 55 | if title and content: # if content and title are available then add the notes by calling the add_note function 56 | add_note(title, content) 57 | else: 58 | st.error("Title and content are required.") # error message. 59 | elif menu_option == "List Notes": #option 02 60 | st.header("List of Notes") # heading 02 61 | list_notes() # calling list_notes function 62 | elif menu_option == "View Note": # option 03 63 | st.header("View a Note") # heading 03 64 | title = st.text_input("Enter the title of the note:") # textbox widget 65 | if st.button("View Note"): # button 03 66 | if title: # if the given title is available then display that file by calling view_note 67 | view_note(title) 68 | else: 69 | st.error("Title is required.") # error messages. 70 | elif menu_option == "Delete Note": # option 04 71 | st.header("Delete a Note") # heading 04 72 | title = st.text_input("Enter the title of the note:") 73 | if st.button("Delete Note"): # button 04 74 | if title: # if the given title is available then call the delete_note function to delete the notes. 75 | delete_note(title) 76 | else: 77 | st.error("Title is required.") # error message. 78 | 79 | 80 | -------------------------------------------------------------------------------- /novatechtask1.py: -------------------------------------------------------------------------------- 1 | 2 | import pandas as p #importing pandas module 3 | 4 | data1=p.read_csv('C:/Users/HP/Downloads/test.csv') #reading a kaggle test dataset using pandas modulle. 5 | data2=p.read_csv('C:/Users/HP/Downloads/train.csv') #reading a kaggle train dataset using pandas modu 6 | data3=p.read_csv('C:/Users/HP/Downloads/gender_submission.csv') #reading a kaggle gender_submission dataset using pandas modu 7 | 8 | print("DataSet1\n\n",data1) # Displaying the Entire datasset1 9 | print("\n\nDataSet2\n\n",data2) # Displaying the Entire datasset2 10 | print("\n\nDataSet3\n\n",data3) # Displaying the Entire datasset3 11 | 12 | print("\n\nFirst Five rows in dataset1\n\n",data1.head()) #head func will display only the first five records in the csv file. 13 | print("\n\nLast Five rows in dataset1\n\n",data1.tail()) #tail func will display only the last five records in the csv file. 14 | print("\n\nFirst Five rows in dataset2\n\n",data2.head()) #head func will display only the first five records in the csv file. 15 | print("\n\nLast Five rows in dataset2\n\n",data2.tail()) #tail func will display only the last five records in the csv file. 16 | print("\n\nFirst Five rows in dataset3\n\n",data3.head()) #head func will display only the first five records in the csv file. 17 | print("\n\nLast Five rows in dataset3\n\n",data3.tail()) #tail func will display only the last five records in the csv file. 18 | 19 | #Our task is to find the mean, median, mode and other basic statistics. 20 | print("\n\nDescription of dataset1\n\n",data1.describe()) # It displays the description of the dataset like count, mean value, standard deviation, min and max value. And various quatiles from 25% to 75%. 21 | print("\n\nDescription of dataset2\n\n",data2.describe()) #It displays the description of the dataset like count, mean value, standard deviation, min and max value. And various quatiles from 25% to 75% 22 | print("\n\nDescription of dataset3\n\n",data3.describe())#It displays the description of the dataset like count, mean value, standard deviation, min and max value. And various quatiles from 25% to 75% 23 | 24 | print("\n\nColumns in DataSet1\n\n",data1.columns) # It returns all the columns name in the dataset1. 25 | print("\n\nColumns in Dataset2\n\n",data2.columns) # It returns all the columns name in the dataset2. 26 | print("\n\nColumns in Dataset3\n\n",data3.columns) # It returns all the columns name in the dataset3. 27 | 28 | '''Let's find the mean, median, mode of column passangerId in all the datasets''' 29 | print("\n\nMean of passangerId in Dataset1\n\n",data1['PassengerId'].mean()) #Finding mean value of passengerId column 30 | print("\n\nMean of passangerId in Dataset2\n\n",data2['PassengerId'].mean()) #Finding mean value of passengerId column 31 | print("\n\nMean of passangerId in Dataset3\n\n",data3['PassengerId'].mean()) #Finding mean value of passengerId column 32 | 33 | print("\n\nMedian of passangerId in Dataset1\n\n",data1['PassengerId'].median()) #Finding median value of passengerId column 34 | print("\n\nMedian of passangerId in Dataset2\n\n",data2['PassengerId'].median()) #Finding median value of passengerId column 35 | print("\n\nMedian of passangerId in Dataset3\n\n",data3['PassengerId'].median()) #Finding median value of passengerId column 36 | 37 | print("\n\nMode of passangerId in Dataset1\n\n",data1['PassengerId'].mode()) #Finding mode value of passengerId column 38 | print("\n\nMode of passangerId in Dataset2\n\n",data2['PassengerId'].mode()) #Finding mode value of passengerId column 39 | print("\n\nMode of passangerId in Dataset3\n\n",data3['PassengerId'].mode()) #Finding mode value of passengerId column 40 | 41 | print("\n\nDisplay Mean Value of Each columns\n\n",data1.mean(numeric_only=True)) # It returns the mean value of each columns which are numeric datatype 42 | print("\n\nDisplay Mean Value of Each columns\n\n",data2.mean(numeric_only=True)) # It returns the mean value of each columns which are numeric datatype 43 | print("\n\nDisplay Mean Value of Each columns\n\n",data3.mean(numeric_only=True)) # It returns the mean value of each columns which are numeric datatype 44 | 45 | print("\n\nDisplay Median Value of Each columns\n\n",data1.median(numeric_only=True)) # It returns the median value of each columns which are numeric datatype 46 | print("\n\nDisplay Median Value of Each columns\n\n",data2.median(numeric_only=True)) # It returns the median value of each columns which are numeric datatype 47 | print("\n\nDisplay Median Value of Each columns\n\n",data3.median(numeric_only=True)) # It returns the median value of each columns which are numeric datatype 48 | 49 | print("\n\nDisplay Mode Value of Each columns\n\n",data1.mode(numeric_only=True)) # It returns the mode value of each columns which are numeric datatype 50 | print("\n\nDisplay Mode Value of Each columns\n\n",data2.mode(numeric_only=True)) # It returns the mode value of each columns which are numeric datatype 51 | print("\n\nDisplay Mode Value of Each columns\n\n",data3.mode(numeric_only=True)) # It returns the mode value of each columns which are numeric datatype 52 | 53 | --------------------------------------------------------------------------------