Category

DATA ANALYSIS

Category

Building an Interactive Sales Data Q&A App with PandasAI and Streamlit In this post, we’ll explore a Python code snippet that creates a dynamic sales data query application using Streamlit, Pandas, and PandasAI. This setup allows users to ask pre-defined questions or type their own to analyze sales data. The Full Code Here’s the code in action: import os import streamlit as st import pandas as pd from pandasai import Agent import yaml # Load API key from config.yaml with open(“config.yaml”, “r”) as file:     config = yaml.safe_load(file) os.environ[“PANDASAI_API_KEY”] = config[“PANDASAI_API_KEY”] # Sample DataFrame sales_by_country = pd.DataFrame({     “country”: [“United States”, “United Kingdom”, “France”, “Germany”, “Malta”, “Spain”, “United States”, “United Kingdom”,],     “sales”: [5000, 3200, 2900, 4100, 5200, 6300, 5200, 3400],     “year”: [2023, 2023, 2023, 2023, 2023, 2023, 2024, 2024] }) # Initialize the PandasAI agent agent = Agent(dfs=sales_by_country) # Streamlit interface st.title(“PandasAI Q&A Interface”)…

Lead Management – Stage Flow – V9 Διαχείριση επιχειρηματικών ευκαιριών – Στάδια – V9 Δείτε πως μπορείτε να χρησιμοποιήσετε Google Sheets μαζί με Apps Script και να έχετε ένα πολύ όμορφο πρόγραμμα διαχείρισης επιχειρηματικών ευκαιριών. To πρόγραμμα αυτό μπορεί να παραμετροποιηθεί ανάλογα με τις ανάγκες του κάθε τμήματος πωλήσεων. Εδώ βλέπετε πως μπορεί ο κάθε χρήστης εύκολα να δει σε ποιο στάδιο βρίσκεται ο κάθε πελάτης (lead). Τα στάδια είναι αυτά που βλέπετε στη φωτογραφία. =>Lead/Ευκαιρία =>Contacted/Έχει γίνει επαφή με πελάτη =>Pitched/Έχει γίνει παρουσίαση στον πελάτη =>Sent Demo/’Εχει σταλεί demo στον πελάτη =>Negotiating/Σε διαπραγμάτευση με τον πελάτη =>Closed-Won/Έχει κλειστεί συμφωνία με τον πελάτη =>Closed-Lost/Έχει χαθεί η επιχειρηματική ευκαιρία να συνεργαστούμε με τον πελάτη Υπάρχει πλήρες ιστορικό των ενεργειών για κάθε πελάτη και ο διαχειριστής μπορεί να δει τις ενέργειες όλων των χρηστών για κάθε πελάτη. Για την υλοποίηση του προγράμματος αυτού χρησιμοποιήθηκαν: Google Sheets Google Apps Script Μη διστάσετε να…

Code Overview: Interactive Sales Data Analysis with Python and PandasAI # Sample DataFrame sales_by_country = pd.DataFrame({     “country”: [“United States”, “United Kingdom”, “France”, “Germany”, “Italy”, “Spain”, “Canada”, “Australia”, “Japan”, “China”, “Malta”],     “sales”: [5000, 3200, 2900, 4100, 2300, 2100, 2500, 2600, 4500, 7000, 2900] }) This Python code creates an interactive desktop application for analyzing sales data across various countries. The application, built with tkinter, allows users to select from predefined analytical questions and view dynamic responses based on data processed with pandas and PandasAI. Here’s a breakdown of the functionality: Data and API Setup A sample DataFrame, sales_by_country, stores country names and their respective sales figures. An API key is securely loaded from a config.yaml file to enable communication with PandasAI, an AI-powered data analysis tool, which provides language-based data interaction. User Interface with tkinter Main Window: A tkinter window, titled “PandasAI Question Selector,” is created to…

Are you tired of spending countless hours on repetitive Excel tasks? Do you wish there was an easier way to boost your productivity and automate your spreadsheets? Enter Business Scripts: Automate Excel with VBA and Python. With these powerful tools, you can create scripts to handle complex calculations and workflows—whether you’re at your desk or away. Imagine automating tedious tasks, even while you sleep! Want to learn how? Explore the “Automate Workflow Everywhere” and “Microsoft Excel Tips” sections on my blog, where you can dive into articles and listen to tutorials on using VBA and Python to supercharge your Excel automation and simplify your work. Here’s what you’ll learn: • How to write reusable scripts that work across any spreadsheet • Create simple applications for data collection and management • Build self-running automation processes that work in the background—no need to even click a button! You’ll achieve more in less…

Problem I want to make sure that all salespersons are notified, either by email or a pop-up window, about which customers have exceeded 80% of their credit limit, so they can act upon it. Solution This excel file. I have to find a way to: 1) Merge data from three different sheets — Customer Balance, Credit Limit, and Salesperson Data — into the sheet CustomerData. 2) Send warning emails to Salespersons when the account balance of their customers exceeds 80% of their credit limit. 3) Format the merged data by Salesperson using different background colors, bold text and “!” next to the Customer Name when an account balance is equal to or exceeds 80% of the credit limit. YouTube link: https://www.youtube.com/watch?v=Ln2_NAq3Tq8&t=99s VBA credit : Tryfon Papadopoulos

Αυτόματη ενημέρωση ανά 1 λεπτό δεδομένων φύλλου εργασίας ‘Customer Balance’ αρχείου excel demo_customers_data.xlsm από δεδομένα άλλου φύλλου εργασίας ‘Customer Balance’ αρχείου excel demo_customers_data_source.xlsm. Το δεύτερο αρχείο excel: demo_customers_data_source.xlsm είναι η πηγή από το οποίο αντιγράφονται τα δεδομένα στο πρώτο αρχείο excel: demo_customers_data.xlsm. Watch the video on YouTube: https://youtu.be/-RCvbX7SZxU #automation #excel_tips #mindstormGR

SEO Analysis of a post ranking first in Google – Ανάλυση SEO ενός άρθρου και κατάταξή του ως πρώτο αποτέλεσμα στην Google χωρίς κόστος διαφήμισης Video and Python SEO Analyzer script credit: Tryfon Papadopoulos YouTube link: https://www.youtube.com/watch?v=e50wmaWDDJk FB Tags: #seo_analysis #python_script #python_coding #google_ranking #keywords #blogging / www.mindstorm.gr

The Excel Box Cost Proposal Project for Softexperia.com (FB link) Markup Calculation – Υπολογισμός Περιθωρίου Κέρδους στην Τιμή Αγοράς Profit Margin Calculation – Υπολογισμός Περιθωρίου Κέρδους στην Κανονική Λιανική Τιμή Retail Regular Price Calculation – Υπολογισμός Κανονικής Λιανικής Τιμής Retail Sale Price Calculation – Υπολογισμός Λιανικής Τιμής με έκπτωση FB Tags: #mindstormGR #softexperia #the_excel_box #cost_proposal 1) Calculate retail regular price and markup on cost price for a given profit margin 2) Calculate retail sale price for a given retail discount on a retail regular price Watch the video on YouTube Credit: Tryfon Papadopoulos L e t t i n g  t h e  d a t a  s p e a k  f o r  t h e m s e l v e s Original *”Inanimate data can never speak for themselves, and we always bring to bear some conceptual framework, either intuitive and ill-formed, or tightly and…

A company pays 7000 for a new machine, plans a 20% annual return on the investment, and expects these annual cash flows over the next six years. Is this investment good or not? Explain why is good or bad. To evaluate whether this investment is good or not, we can calculate the Net Present Value (NPV) and the Internal Rate of Return (IRR) of the investment. These metrics will help us understand if the investment meets or exceeds the company’s required rate of return of 20% annually. Explanation of the Investment Decision Net Present Value (NPV): NPV calculates the present value of cash flows, discounted back at the required rate of return (20% in this case). The formula for NPV is: If the NPV is positive, the investment is considered good because it is expected to generate more cash flows than the cost of capital. Internal Rate of Return (IRR):…

Επιβεβαίωση και ξεπεπιβεβαίωση Όλα τα zoogles είναι boogles. Μόλις είδατε ένα boogle, είναι zoogle; Όχι αναγκαστικά δεδομένου ότι όλα τα τα boogles δεν είναι zoogles. Όσοι έφηβοι κάνουν λάθος όταν απαντούν σε αυτό το είδος ερωτήσεων στο SAT (Scholastic Aptitude Test για εισαγωγή στην τριτοβάθμια εκπαίδευση στις ΗΠΑ), κινδυνεύουν να μην μπουν στο πανεπιστήμιο της αρεσκείας τους. Και όμως, μπορεί κάποιος που πήρε λαμπρούς βαθμούς στο SAT, να αισθανθεί ιδιαίτερη ανησυχία όταν κάποιος από λάθος γειτονιά της πόλης μπει στο ασανσέρ. Αυτή η αδυναμία να μεταβιβαστεί αυτόματα γνώση και εκλεπτυσμένη αντίληψη από μια κατάσταση σε άλλη, ή από τη θεωρία στην πράξη, αποτελεί ένα ιδιαίτερο δυσάρεστο γνώρισμα της ανθρώπινης φύσης. Ας το ονομάσουμε περιβαλλοντική εξάρτηση των αντιδράσεών μας. Όταν αποκαλώ τις αντιδράσεις μας περιβαλλοντικά εξαρτημένες εννοώ ότι αυτές, καθώς και ο τρόπος σκέψης μας, η διαίσθησή μας, όλα εξαρτώνται από το φόντο μπροστά στο οποίο παρουσιάζεται το ζήτημα, εκείνο δηλαδή…

Websites Hellenic-land.com Το Hellenic-Land.com είναι μία ηλεκτρονική δίγλωσση πλατφόρμα στα ελληνικά και στα αγγλικά που ξεκίνησε το 2015 με σκοπό την υποστήριξη και την  προώθηση όσο το δυνατόν περισσότερων νέων δημιουργών & προμηθευτών ελληνικών και κυπριακών προϊόντων καθώς και παρόχων υπηρεσιών σε έδαφος Ελλάδας και Κύπρου, οι οποίοι επιθυμούν να αναδείξουν, να διαφημίσουν και να προωθήσουν τα προϊόντα τους ή/και τις υπηρεσίες τους όχι μόνο στην Ελλάδα και στην Κύπρο, αλλά και στο εξωτερικό. Wordpress What is CMS (Content Management System)? https://mindstorm.gr/what-is-cms-content-management-system/ Woocommerce – Compare different sheets and then Add New or Update Existing Products from CSV files https://mindstorm.gr/woocommerce-compare-different-sheets-and-then-add-new-or-update-existing-products-from-csv-files/ Python Read and extract text from a PDF file Excel and Python work great together – VBA Macro and Python script Rag Web Scraper + Ollama (Python 3.13) Data Analysis Creation of SKU QR Codes, SKU Barcodes and SKU Product URL QR Codes with VBA https://mindstorm.gr/creation-of-sku-qr-codes-sku-barcodes-and-sku-product-url-qr-codes-with-vba/ Microsoft Access Tips Microsoft Excel…

Python & Excel Αυτόματη δημιουργία των αρχείων data_excel2.xlsx με γράφημα και data_excel3.xlsx (pivot table) από το αρχείο data_excel.xlsx (πηγή δεδομένων) με χρήση γλώσσας python. Το μόνο που έχετε να κάνετε είναι να γράψετε το όνομα του προγράμματος μας στη γραμμή εντολών και τα αρχεία data_excel2 και data_excel3 θα δημιουργηθούν αυτόματα. Αν πρέπει να επεξεργάζεστε συχνά δεδομένα και σας παίρνει χρόνο, μπορούμε να σας βοηθήσουμε να το κάνετε γρήγορα και χωρίς λάθη. Email : info@softexperia.com #office_automation #python #softexperia / fb : Softexperia.com

1) Creation of SKU QR Codes in Excel with a button (VBA) 2) Creation of Product URL QR Codes in Excel with a button (VBA) 3) Creation of SKU Barcodes in Excel with a button (VBA) 4) Update of ‘Product’ Column with SKU, Name, Attribute 1 value(s), Attribute 2 value(s), Type and Regular Price with a button (VBA) – two versions 5) Creation of a word file with SKU Barcode Labels based on quantity with a button (VBA) – SKU can be scanned on labels – 3 labels per row, 15 labels per page 6) Creation of a word file with SKU Barcode Labels based on quantity with a button (VBA) – SKU cannot be scanned on labels – 3 labels per row, 15 labels per page YouTube

Sheet ‘Jan’ is the Product List of Supplier A for January. Sheet ‘Feb’ is the Product List of Supplier A for February. Compare them and do the following: 1) Add columns ‘Status’ and ‘Previous Price’ 2) Highlight new SKUs with yellow color with a button (VBA) 3) Highlight existing SKUs with different price with green color (VBA) and update columns ‘Status’ and ‘Previous Price’ 4) Clear Row highlights with a button (VBA) 5) Delete columns ‘Status’ and ‘Previous Price’ YouTube #mindstormGR #excel_tips / www.mindstorm.gr

Sales Data Analysis Tasks 1) Get New Sales Raw Data (table) 2) Change sorting for Sales Raw Data using field ‘Value’ DESC (descending order) and then field ‘Country’ ASC (ascending order) 3) Create 5 Pivot Tables Total Sales by Country Total Sales by Salesperson Total Sales by Customer Total Sales by Product Category Total Sales by Product Description 4) Change sorting to all 5 Pivot Tables Total Sales by Country DESC Total Sales by Salesperson DESC Total Sales by Customer DESC Total Sales by Product Category DESC Total Sales by Product Description DESC YouTube video:  Create 5 Pivot Tables with a button (VBA) FB Tags: #vba #data_analysis #excel_tips #mindstormGR

Use of chatGPT and YouTube to become a Data Analyst – Χρήση του chatGPT και του YouTube για να κάνει κάποιος ανάλυση δεδομένων Code file: app.py Folder: C:\PythonPrograms\data_analysis_with_chatGPT 1) Merge multiple excel files – Συγχώνευση πολλών αρχείων excel data1.xlsx data2.xlsx data3.xlsx data4.xlsx 2) Clean data – Καθαρισμός δεδομένων 3) Create two excel reports (Total Revenue, Expenses and Profit by Category) and (Total Revenue, Expenses and Profit by Country) – Δημιουργία δύο αρχείων excel (category_report.xlsx and country_report.xlsx) 4) Add a chart to category_report.xlsx – Προσθήκη γραφήματος στο αρχείο excel category_report.xlsx 5) Add a chart to country_report.xlsx – Προσθήκη γραφήματος στο αρχείο excel country_report.xlsx 6) Build two interactive plots (category_chart.html and country_chart.html) 7) Create a streamlit dashboard with 2 graphs – Δημιουργία ενός πίνακα προβολής και διαχείρισης streamlit με 2 γραφήματα με τη βοήθεια της γλώσσας Python – with Python. Changed code by Trifonas Papadopoulos: #Code starts…

Scenario for using Python and Excel Request 1 Take the following 3 excel files: sales_jan_2022.xlsx sales_feb_2022.xlsx sales_mar_2022.xlsx and create a new excel: sales.xlsx and a new csv file: sales.csv with all the records from these 3 excel files. Request 2 Take the following 3 excel files: sales_jan_2022.xlsx sales_feb_2022.xlsx sales_mar_2022.xlsx and create a new excel: total_sales.xlsx and a new csv file: total_sales.csv with total of Actual_Quantity for each month. Request 3 Take the following 3 excel files: sales_jan_2022.xlsx sales_feb_2022.xlsx sales_mar_2022.xlsx and create a new excel: total_sales_by_salesperson.xlsx and a new csv file: total_sales_by_salesperson.csv with total of Actual_Sales per month for each salesperson. Request 1, 2 and 3 are completed with python script: main.py. See it in action . . . (watch the video below) Request 4 Take the following excel files: sales.xlsx total_sales_by_salesperson.xlsx and change the styling so it is easier to read them. Request 4 is…

Πως να επιλέγετε γραμμές και στήλες με τη βιβλιοθήκη pandas της γλώσσας προγραμματισμού Python See below the data and the code for the result shown on image . . . How to select rows and columns in pandas # Credit : Trifonas Papadopoulos, Oct 4th, 2022, Version 2.0 # start of code —————————————————————————————– import pandas as pd import numpy as np # data data = [[‘A0001′,”,”,”,0,’variable’,0,0], [‘A0001′,’WHITE’,’S’,’Small’,1,’variation’,0,0], [‘A0001′,’WHITE’,’M’,’Medium’,2,’variation’,0,0], [‘A0001′,’WHITE’,’L’,’Large’,3,’variation’,0,0], [‘A0001′,’WHITE’,’XL’,’Extra Large’,4,’variation’,0,0], [‘A0001′,’BLACK’,’L’,’Large’,5,’variation’,0,0], [‘A0003′,”,”,”,6,’variable’,0,0], [‘A0003′,’BLACK’,’XL’,’Extra Large’,7,’variation’,0,0], [‘A0002′,”,”,”,8,’variable’,0,0], [‘A0002′,’BLACK’,’L’,’Large’,9,’variation’,0,0], [‘A0002′,’BLACK’,’XL’,’Extra Large’,10,’variation’,0,0], [‘A0004′,”,”,”,12,’variable’,0,0], [‘A0004′,’WHITE’,’S’,’Small’,12,’variation’,0,0], [‘A0004′,’RED’,’S’,’Small’,13,’variation’,0,0], [‘A0004′,’RED’,’M’,’Medium’,14,’variation’,0,0], [‘A0001′,’WHITE’,’XXL’,’2 Extra Large’,15,’variation’,0,0], ] # print list of columns print(‘–list of columns———————————————————–‘) cols = list(df.columns.values) print(cols) # dataframe with defined column names df = pd.DataFrame(data, columns=[‘parent’, ‘color’, ‘size’, ‘size_desc’, ‘order’, ‘type’, ‘quantity’,’price’]) print(”) print(‘–dataframe with defined column names—————————————‘) print(df) # end of code —————————————————————————————– If you want to see more ways to select rows and columns in pandas (Python), read my code (Version…

Let’s assume that you have 2 excel files : product_data_excel.xlsx (99 rows x 5 columns, A2: E100) product_data_excel_2.xlsx (107 rows x 5 columns, A2:E108) The 5 columns of the two excel files are : product_id, product_description, quantity, regular_price and category.product_data_excel.xlsx You have changed quantity and price values for existing product_ids : “A0001” and “A0003” (column : “product_id”) and you have added 8 new products in excel file : product_data_excel_2.xlsx. product_data_excel_2.xlsx Now you want to compare product_data_excel.xlsx and product_data_excel_2.xlsx and create a new excel file  : product_data_excel_changed_and_new_records.xlsx and csv file : product_data_excel_changed_and_new_data.csv with the 2 existing products you have changed and the 8 new ones you have added. product_data_excel_changed_and_new_records.xlsx Download product_data_excel.xlsx, product_data_excel_2.xlsx, product_data_excel_changed_and_new_records.xlsx, product_data_excel_changed_and_new_records.csv Click comparing_data_values_between_2_excel_files to see the code (html format) . . .

Pin It