SnowFlake universe, part#4 using 3rd party Python modules

Enhancing SnowPark Notebook capabilities

SnowSpark as the online notebook app of the SnowFlake system may be upgraded in functionality. Not suprisingly, but coming from Python nature additional modules can be imported to enhance data handling. There are several modules such as scikit learn for analysis and AI functionality with included visualization ability or 'simple' data visualization tools as matplotlib or seaborn (see more).

Streamlit, the app generator 

Streamlit website and a demo to start with if you are or become interested in it.

"Streamlit turns data scripts into shareable web apps in minutes.
All in pure Python. No front‑end experience required." (Streamlit website)

Streamlitis an open-source Python library that allows data scientists and developers to easily collaborate, quickly and easily develop interactive data visualizations and web applications with minimal web (html, css, php/javascript) development skills. Streamlit stands out from the market by enabling rapid prototyping and further developments through its streamlined and simple development process.

It is a software having increasing impact on the market among similar applications, here you find the most widely used data visualization and web application development tools:

  • Dash (Plotly, Python-based)
  • Panel (HoloViz library, also Python-based)
  • Shiny (for R, from RStudio)

Why Streamlit?

Ease of use and fast development, which is "one of Streamlit's biggest advantages because it has an intuitive API, so data analysts and data scientists can quickly build interactive apps with just a few lines of Python code."

Rapid app development is made easier also because the app automatically reloads itself after changes are made to the code, making the development process fast and flexible. That is valid, if you don't mess up a step of the development process.😊

The dozens of built-in visualization and interactive components (e.g. sliders, text boxes, radio buttons) make interaction more satisfying for end users on the app's user side. Individual Streamlit components can be easily embedded into applications, even into a SnowPark Notebook. A typical case is, for example, that setting the minimum and/or maximum values of a slider causes the query from the database to run again with the changed parameter and thus update the (filtered) extracted data from the dataset according to the user's expectations.

Sliders demo made by Streamlit (source: their slider documentation website):

 If it does not work see image.

My own test on slider functionality: filtering fetched data by defining lower price limit (on a tutorial dataset) is shown in the following video. Read the notebook notes (markdown parts) in the video for better understanding.

After importing the Streamlit module we declare min_price variable with a given value received from a slider (range) set by the user.
import streamlit as st
st.markdown("# Move the slider to define lower price limit to filter data")
#col1 = st.columns(1)
#with col1:
min_price = st.slider('Define min_price', 1, 20, 2)

After the interactive slider is activated a Python query using previously defined variable min_price (1 line of code) can filter the result of the query, which is taken from that restricted part of the whole dataset, where the company is called 'Freezing point'.

df_menu_freezing_point[df_menu_freezing_point['SALE_PRICE_USD'] \
    > min_price][['TRUCK_BRAND_NAME','MENU_ITEM_NAME','SALE_PRICE_USD']]

A similar, but SQL query using the previously defined variable min_price as lower sale price limit, now querying the whole dataset including all companies:

SELECT truck_brand_name, menu_item_name, sale_price_usd
FROM tasty_bytes_sample_data.raw_pos.menu
WHERE sale_price_usd > {{min_price}}

Streamlit has the added advantage of being able to integrate with popular data visualization libraries such as Matplotlib, Plotly and Altair, and therefore, although not by itself, but offers a wide range of data visualization options through integrated systems. Accordingly, its visualization capabilities are basically determined by the integrated python module.

Streamlit Cloud also offers Cloud support, making it easy to share and run prototypes and applications. Find examples in the Streamlit App Gallery. Funny on its own reflection how..., but still impressive cheat-sheet website of Streamlit development made as an app by Streamlit itself.

In terms of the SnowFlake system, Streamlit has the advantage of being able to connect directly to the SnowFlake data warehouse, making it easy to create interactive data visualizations based on data from SnowFlake and take advantage of the backend solutions provided by the SnowFlake system. This can be particularly useful for data analysts and business decision makers as they can query and visualize data from SnowFlake in real time. In simpler cases, this can even replace the use of more expensive BI software (I am not listing any software here, being respectful).

Streamlit compared to other software on the market

Streamlit is not suitable for the development of large and complex (multimodal) web applications, as it has limited scalability and does not support detailed user permissions, nor advanced front-end customization options.

If an application requires multiple pages, complex navigation or detailed user identification, Streamlit is not an ideal choice as it does not support these features well. In this respect, Dash or Shiny may offer more options.

Streamlit applications are ideal for smaller data visualization projects, but if you are working with more complex or larger data sets on the input side, or need to display multiple types of data on the output side, or need to serve multiple users simultaneously, performance can be severely degraded or constrained for the development team and for the end-user as well.

Note that Dash or Panel offers more customisation and performance optimisation options.

The lack of built-in data manipulation tools, as well as the aforementioned data visualization toolset, relies on the integration ability with various data processing libraries, such as Pandas, with Pandas’ own built-in data manipulation tools. Data processing must be handled by separate modules and the results returned to the Streamlit application for final visualization. This is not necessarily a real disadvantage as python users got used to this mentality, but in the case of Dash and Shiny, the full integration of Plotly and R-Studio as data manipulation software gives a wider range of built-in data processing capabilities. I would say it makes coding simpler in the latter case, but it is not an unbearable situation to push-and-pull data between modules.

Streamlit allows more limited functionality, so applications with complex operations cannot be created with it. The queries themselves (math or code) can be complex, but they cannot, for example, be built on top of each other.

Not sure if it's actually a drawback, but Streamlit is specifically Python-based and from there on is not sympathetic to R-using statisticians (as far as I know). Dash may be more popular among statisticians and data scientists because it's more versatile for Python and R developers (I have not checked market data in regard of this topic).


Stored Python procedures

(Almost) everyone heard about stored SQL procedures, but this is about stored Python procedures which is rarely found on the market. Read more about the topic.

SnowFlake universe, part#3 Initializing the system

Initializing the SnowFlake system - back to the beginning

Signing up

... is easy (but nowadays it is almost true for every site who does not want to bother it's provisionary user by time-wasting steps).

"HIPAA, PCI DSS, SOC 1 and SOC 2 Type 2 compliant, and FedRAMP Authorized" says the website's first page when trying to create an account. OK, check it for yourself if you want to know more, I was concentrating on getting into the system. 

You must select a cloud provider and define it’s location from a dropdown list. I chose Microsoft Azure.


Image captcha check should be accomplished for safety reasons. Then some questions should be answered to better serve your needs, but only a minimal amount. Name and email address should be given at first step
 
 
As the next step you are noted that you have succeded and an email has sent to your email address given. At the bottom of the left panel $400 credit is shown to be consumed during your 30 days of trial period. Well, we are already there!

Some help is provided in form of links to help you to start (which they consider to be relevant):
  • "GETTING STARTED VIDEO" - 8 minutes about the whole system.
  • VIRTUAL HANDS-ON LAB - "Join an instructor-led, virtual hands-on lab to learn how to get started with Snowflake"
  • FULL SNOWFLAKE DOCUMENTATION - the link to the documentation of SnowFlake ecosystem

Time travel - a 90 days Warehouse data storing management option to reach historical data, of course costs money. Not important for studying purposes. 

Multi-cluster warehouses - "Snowflake supports allocating, either statically or dynamically, additional clusters to make a larger pool of compute resources available." Of course costs money and this is also not important for studying purposes. 

Materialized Views - which basically is a pre-computed data set deriving from a query and stored for later use, therefore it provides way faster execution against the base table of the view.

Setting the environment parameters

Warehouses are for storing data but the engine should also be defined at the beginning of our data processing to ensure optimal time and costs ratio. As SnowFlake resources can easily be scaled (keep in mind the economical consequences) for very large datasets or for complex queries/calculations X-SMALL size is not enough!

 
The COMPUTE_WH (default name of the) warehouse should be started from the originally suspended state (see on the images above). Here you can see that X-SMALL with 1 cluster was set to deal with the (simple) queries I made on the offered relatively large datasets and still the result was presented in a few seconds. 

Get some data

If the engine is running already now we need some data to target for analysis. There are plenty options to load data to the SnowFlake system. There are connectors to a large variety of Data lakes or Warehouses like Amazon S3, Microsoft Azure or Google Cloud Platform,
but other connectors can also be selected in the left menu under Data / Add data option, frmo which I chose SnowFlake Marketplace (3rd line, most right one):
I aimed for some financial data to be able to create time series plots. The steps of selecting and loading of the dataset:

For SnowFlake tutorial on loading sample data of "Tasty bytes" by following the detailed documentation or one of the SQL or Python tutorials (Projects / Worksheets in the left panel menu):

Finance & Economics from Cybersyn was chosen: "Aggregate financial data for the banking industry. Calculate the total quarterly net income for the banking industry over the last four decades."

As final step additional roles of the (current) user may be defined.
 
It sounds appropriate for my study goals and importantly it is free (there are dozens of free datasets available).

There are several points on the SnowFlake system how it shows that you reached the required dataset after pushing the Get data button.

 

Clicking on the 3 dots beside the dataset name provides some information and also some options to change some properties:

The currently added database appers in the list of available databases.

It ease the selection of dataset that SnowFlake provides an insight to the data before selection (loading), both in regard values and data types:

Set the context

The context of the whole warehouse-engine system should be done before running any code. If not set then "Data not found" error is indicated (see the middle of the image), in this case below the warehouse was not running.


Warehouse (named COMPUTE-WH as default)then was set to started state from suspended.
 

From the FINANCE_ECONOMICS dataset CYBERSYN was selected (not the Information schema):


Now the Python/SQL codes can run (in SnowPark notebook) resulting in demanded data. Have fun!









SnowFlake universe, part#2 SnowPark Notebook

 SnowPark Python - Notebook

"The Snowpark API provides an intuitive library for querying and processing data
at scale in Snowflake."
SnowPark supports three coding languages JavaPython, and Scala, and SQL codes can also be injected into the Notebook (note that SnowPark SQL motor is limited to standard SQL syntax compared to some other SQL engines on the market). SnowFlake system also provides tools and tutorials on AI and ML practices using their services.

How to use Notebooks is a helpful guide for the first steps among the wide range knowledge base present on SnowFlake Tutorials website.

I found really helpful the option that 3rd party python packages may be added easily to the SnowPark Notebook or Worksheets and thus you can integrate a Slider for interactive SQL/python queries (SnowFlake docs or my slider test

I chose the so called Tasty Bytes learning dataset to verify the useability of the website, both in case of testing SQL or Python in SnowPark.


Database and table was created, besides (minimal) resources were selected: COMPUTE_WH is the default engine name, X-Small is the smallest capacity selectable.


Notebook in SQL mode

As usual, lines (cells) may be defined to be interpreted as SQL or Python code lines or used only for notes or for (formatted) text for e.g. teaching purposes such as markdown lines.

As a simple step dataset was fully loaded to get to know the content.

First, data was copied to a database on SnowFlake from a given site (as defined in the tutorial):

At every step resources and process time is indicated on the right side. This helps to calculate the consumed resources and consequently the price of the data handling, but also can be help for code (or data loading) optimization leading to cheaper operation.
Dataset parameters may be extracted using LIST function of SQL

There are different in-built data representation options such as table, plots and line graphs as the usual formats in Notebooks:


Running another SQL query the resulting data may be represented as a Chart instead of a table format:
The X-Y values are automatically recognised by SnowPark system but those can be modified on the right hand side panel, of course only in case of valid settings would the chart show something, otherwise returns with an error pointing out that we made some mistake in the settings.

Heatmap is also an option however the graphical representation is not the best:
Resizability of the cells and some selectable recolouring palette option would highly increase it's readability.
See further details on representation below at Representation in general session.

Notebook in Python mode

As basic concept Notebooks were made originally for Python based tests of data wrangling. I have found that SnowPark has the most requested python functionalities.

importing the required modules
After some preparatory steps the dataset may be used:
The outcome is a (Pandas) DataFrame that can be easily handled for data processing in further steps and can be represented in the above mentioned modes.

SnowPark also offers some function(ality) hints for Python codes which enormously ease the use of the Notebook.


To see more check the Dashboards of SnowFlake which is a simple in design but inevitable tool of all large dataset handling softwares or cloud services.

Representation in general

Independently of using Python or SQL to collect and/or filter our data SnowPark has some robust and reliable methods to represent final datasets. One advantage was noted already, that if Chart option is selected the X-Y axis values are automatically recognised and corresponding values plotted, which may be overwritten or modified to match to our needs or expectations in regard data representation.

I chose another free dataset: Finance & Economics of Cybersyn (about initial steps and data selection you may reed in part#3)

Another a
dvantage of the SnowPark system is that when query results are demonstrated as a table, you may get immediate insight into overall details of the data on the right hand side. By clicking on different columns (header) we get instantaneous breakdown of that columns content and we may also use that bar chart to filter the represented data defining left and right edges of the shown range to match with our interest.  

It is simple to add another dataset to a chart (bar or line colours are defined automatically).


When handling timeseries data the ranges (bucketing) may be easily modified from day to weeks or months or year-quarters, but if data related time is also given not only the date then hours, minutes or seconds can also be selected as base of bucketing.

Here I provide two snapshots of the time settings if the video does not help and with changed to whote background for better visualisation of the line chart menu. Data (number of credit card issues of a special bank) with daily sum up:

and after changing to monthly basis:



Part#1 SnowFlake in general

Part#3 initializing SnowFlake environment

Part#4 using Python 3rd party modules

Part#5 Dashboards

Part#6 AI & ML using SnowFlake ...

SnowFlake universe, part#1

A frequently required application in recent job-offers.

Let's kick this story in with an me info-bomb: here you find a link collection that I read through while checking the functionality of the SnowFlake environment.


As far as I checked the requested software skill lists in job offers on several web platforms, SnowFlake is more and more present in those. I became interested in this service and at first sight it seemed to me highly clean, well-organised and user friendly web-service. 

„A PLATFORM LIKE NO OTHER
Snowflake’s single platform eliminates data silos and simplifies architectures, so you can get more value from your data.”

The motto and the short description suggests that this platform simplifies working with data starting from data loading and storing, through data handling and modification to demonstrations. Simple graphs as line or bar chart are optional output formats, however heat map is also an option but does not have the shiniest graphical representation. On the other hand this is not a problem as SnowFlake mainly serves as a background datastore for BI tools for example Power BI or Tableau. Additionally such full-service (or software as a service) platforms as Microsoft Fabric may also use SnowFlake as data source in its complex system.

SnowFlake is a cloud-based data storage and processing platform designed to manage and analyse large volumes of data. Although it is not the market leader, Snowflake is easily comparable to other similar applications, i.e. cloud-based data management and data analytics data warehouses, such as Amazon Redshift, Google BigQuery, and Microsoft Azure Synapse Analytics (formerly Azure SQL Data Warehouse) and ranks quite well in the comparison. 

On the very first sight it is clearly visible that the developers of SnowFlake had an intention to create a clear and user friendly outlook and they really did an amazing job.

SnowFlake’s services, beside data storing include Python and/or SQL based data manipulation both of which can be used in the platforms’ Notebooks. AI & ML applications can be also easily developed on the Cloud platform. It offers customable resources as storage volume, computational power, numbers of users, projects… in one word a scalable engine. Easy integration of 20+ external resources so other platforms can serve as data storage in the background or may be chosen as options for migrating data to other platforms and get further benefits from involving other services. Scalable, customizable and a real „pay what you use” type of system.

Advantages of SnowFlake

Scalability and performance
   - Snowflake uses a unique, distributed architecture, which means that compute and storage resources can be scaled completely separately, making the data warehouse more cost-effective to run. In similar applications, compute and storage are not separated to this extent, which sometimes limits the flexibility of scalability.
   - With auto-scaling, Snowflake can automatically scale its resources based on workload, enabling high-performance data analysis even under varying workloads.

Simple use and administration
 - Snowflake users do not need to manage separate servers or infrastructure, so the administration of data management is much simpler than at some other platforms.
 - It provides easy integration with other cloud services, which simplifies the consistent storage and access/management of different data. Snowflake supports multiple cloud platforms, such as AWS, Google Cloud, and Azure, giving users the freedom to choose between infrastructures and making it easier to build a multi-cloud strategy.

Data sharing and security
 - Snowflake's innovative data sharing capabilities enable secure and real-time data sharing with other Snowflake users without the need to create data copies. This makes data sharing more efficient and reduces problems related to managing redundant data.

Deficiencies

Costs
- Although flexible and cost-effective in terms of scalability, in some cases long-term costs may be higher. With some providers, large enterprise discounts may be more cost effective.
Limitations of integrations and tools
- Although well integrated with major cloud providers, the range of data integration and ETL tools may seem limited compared to some other platforms.

SQL support and custom functionality
- Snowflake has the SnowSQL engine that does not support all special statements outside the SQL standard. This may be a slight disadvantage for those who want to use the custom SQL syntax that is common in other SQL engines. But of course, this can also be seen as a standards-compliant approach.

Dependence on cloud providers
 - Although it supports several cloud providers, being a fully cloud-based solution it is not available as a locally deployed version, which some companies prefer for security and privacy reasons.

If you got interested, see pricing or how to become a pro (unfortunately, I have no interest in sharing the links).

Updates

On 01 Dec 2024

How should I have started using and practicing?

My free trial period is over since a week, but it came to my knowledge - when I arranged learned things and these posts - that there are free online discussions organized by Snowflake quite often that may newbies in starting the excursion.

For example I would have watched these:
"ZERO TO SNOWFLAKE IN 90 MINUTES - Virtual hands-on-lab"
or
"SNOWFLAKE DISCOVER - Build the Right Data Foundation to Maximise Your Potential"
Check upcoming events on Virtual hands-on-lab WORKSHOP SERIES website.
As those are ahead of me, I will still attend to get a deeper understanding of the power and functionality of the services.
  

Continue with 

Interactive Jupyter Notebook

How to create interactive Jupyter Notebook or JupyterLab plots.

Fixed view-angle 3D plot
Note1: related Notebook for testing: ipynb, html, pdf or GitHub (Notes2)
Note2: this post is a reflection to my 3D plotter GUI post

If a 3 dimensional (scatter) plot can be converted to a rotatable plot that enormously increases the understanding of the plotted dataset. When zooming / rescaling and saving options are added to the functions that is another positive advantage compared to simple plots achievable using "simple" matplotlib plots.

import matplotlib.pyplot as plt
%maptlotlib inline

The second code line is an iPython magic command, which is the first step in having plots at all in Notebooks. The inline flag allows notebook to display the generated plot in the Notebook, below the ending code.

# displaying the plot 
plt.show()

Note that in such situation matplotlib module creates static images of the 3D dataset at a specific angle that offers a one-angle viewpoint highly limiting proper understanding of the plotted data (see image above on the right).

Interactive plots in Notebooks

There are different ways to get an interactive plot. For example one of these code lines should replace the "%matplotlib inline"

%matplotlib notebook
%matplotlib widget %matplotlib inline

widget reference

The result:

3D plot - rotating 3D plot - zooming 

What if Notebook does not plot the data only creates the interactive part of the plot? With white or the 3D scale background?

Error - white background Error - 3D scale background 
These mean that matplotlib and related modules are not properly installed or enabled in the Notebook application. In my case JupyterLab and Jupyter Notebook are installed as a part of the Anaconda Python package.

Install Node.Js

If Node.Js is not installed yet... it is required to build the Notebook (JupyterLab) widgets extension package. Interactivity requires javascript functionality.
conda install nodejs

You could use -y flag which sets 'yes' for all questions. It is generally not recommended, because it means that either you are aware of possible consequences and then you don't do it, or you just do not care about what happens during installation, which is a dangerous attitude. :)

Upgrade JupyterLab

There may be several reasons for this faulty function, but the most probable is that the installed modules are outdated. It seems that Jupyter notebook version below 8.x can show this buggy behaviour.
conda install --upgrade jupyterlab

The above command run in Anaconda prompt window upgrades your local JupyterLab module.

It is important to note that on every modification the Jupyter server should be restarted, better to run updates/upgrades or additional module installation after shutting down the open Notebook application (and the running server in the background).

Install and allow Notebook extensions

Now you may fall on an error indicating that some Notebook extension ('nbextension') is not working properly. In this case run

conda install -c conda-forge jupyter_contrib_nbextensions
jupyter contrib nbextension install --user

These install the nbextension package as a Notebook server extension first then the second line copies the installed javascript and css files and edits some Jupyter config files for proper functionality.

To enable the extensions run

jupyter nbextension enable --py widgetsnbextension

Adding Matplotlib to Jupyter services

If from the beginning there was no matplotlib module installed for the Jupyter services then

jupyter labextension install jupyter-matplotlib
jupyter labextension install @jupyter-widgets/jupyterlab-manager

commands will allow you to use matplotlib for plotting.

IPYMPL module requested

It may happen that running the plotting code block (cell) in the Notebook returns with an ipympl error. In such case run (as defined in conda install) the i-python-matplotlib installer

conda install conda-forge::ipympl

IPYWIDGETS module requested

install -U ipywidgets

-U flag stands for upgrade (only), in case there was no module preinstalled remove the flag. for complete install

The 3D bar plot code

original code source, modified to use ipympl extension

# creating 3d bar plot using matplotlib  
# in python 
  
# to interact with plot 
%matplotlib ipympl
  
# importing required libraries 
from mpl_toolkits.mplot3d import Axes3D 
import matplotlib.pyplot as plt 
import numpy as np 
  
# creating random dataset 
xs = [2, 3, 4, 5, 1, 6, 2, 1, 7, 2] 
ys = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 
zs = np.zeros(10) 
dx = np.ones(10) 
dy = np.ones(10) 
dz = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 
  
# creating figure 
figg = plt.figure() 
ax = figg.add_subplot(111, projection='3d') 
  
# creating the plot 
plot_geeks = ax.bar3d(xs, ys, zs, dx,  
                      dy, dz, color='blue') 
  
# setting title and labels 
ax.set_title("3D bar plot") 
ax.set_xlabel('x-axis') 
ax.set_ylabel('y-axis') 
ax.set_zlabel('z-axis') 
  
# displaying the plot 
plt.show()
  

Related sites visited while the final solution was reached: https://stackoverflow.com/questions/49647705/jupyter-nbextensions-does-not-appear
https://stackoverflow.com/questions/65357800/i-am-using-matplotlib-widget-but-it-is-not-printing-plots-in-the-output
https://stackoverflow.com/questions/73715821/jupyter-lab-issue-displaying-widgets-javascript-error
https://stackoverflow.com/questions/49647705/jupyter-nbextensions-does-not-appear
https://github.com/jupyterlab/jupyterlab/issues/14270

Animated gifs created with
https://ezgif.com/video-to-gif
https://cloudconvert.com/mp4-to-gif

Interactive 3D scatter plot (GUI)

A 3-dimensional data plotting software for demonstrational purposes. 

Rotate 3D plot
Note2: Interactive Notebook bug fix post (8 Sep 2024)

The original idea came from a clustered data plot in which a part of the full dataset should have been shown only and verified from different angles. This is not doable with a simple Matplotlib plot which creates a still image from a specific angle of view. There is no option to zoom in or to rotate. There are solutions online for interactive plotting with Python line magic (link1, link2, link3) or ipympl (link1, link2, link3) Python widgets involved. I had no success with Anaconda Jupyter notebook (7.0) or JupyterLab (4.0) as applying the widgets I could not get a properly working plot.
This triggered me to create a simple code of a graphical software in which the dataset can be visually reorientated to be able to see the points from any angle of interest. Also, a restricting the plot view to defined parts of the dataset was planned and a simple solution was created.

The software is plotting 3 dimensional (X-Y-Z) data using matplotlib 3D scatter plot. Two datasets are available on pressing the corresponding button:

1) randomized data in the range of 0-100 in all axis, which varies on each button pressing; [Test Random] button

2) iris (flower) dataset from Python scikitLearn package; [Test Iris] button

With the help of this (fixed window size) GUI 3 dimansional data can be (scatter) plotted and rearranged 

- by limiting the range along one or all axis,
- by rotating the plot with mouse gestures.

Rotate 3D plot
Key Features

1)  Buttons

A) The Test Random and Test Iris buttons load the corresponding dataset and plot it.


Two datasets in 3D scatter plot

B) Apply Button
when clicked, it retrieves the values from the editable fields (see below) and applies them to the plot, updating the axis limits.

No field should remain empty!

C) Reset Button
the axis limits are reset to their optimal values (which are the minimum and maximum of the actual data points along each corresponding axis).

This ensures that all points become visible. Use this button if any plot axis range has been changed previously.

D) Clear button
all loaded data is cleared from the plot.

2) Editable Fields

Each axis (X, Y, Z) has a pair of fields for the minimum and maximum values to limit the related axis to a certain range.

These fields are editable, allowing users to input custom values and consequently exclude some parts of the full dataset from the plot.

Push "Apply" button after limits have been modified.

Rescale data (gif, download)

3) Title (Label) a text indicating the title of the current plot.

Initialization and run

On startup, the editable fields are filled in with the optimal limits (i.e., the min and max of the loaded data values).

Calculation of axis limits: The get_optimal_limits method in the Plot3DWidget class calculates the min and max values for each axis, which are initially populated in the editable fields.

Dynamic plot updates: The set_axes_limits method allows dynamic updates to the axis limits based on user input from the editable fields.

Updating the Title (Label):

Whenever plot_random_data or plot_clusters_data is called ("TEST random", "TEST iris" buttons), a (QT Event) signal is emitted that updates the text in the MainWindow label.

Prerequisites: Python modules required
- sys (python default)
- random (python default)
- PyQt5
- matplotlib, mpl_toolkits
- numpy
- sklearn

Notes: Possible functionality developments

- resizable window (fixed size at the moment, the current version is a proof of concept only)
- editable fields value check, user defined number should fall in the min-max range
- determining clusters for the Iris data using SciKitLearn
- UX design development (e.g. inactive/active buttons and editable fields)


Created on Thu Sep 5 20:58:00 2024
Animated gif images created from mp4 https://ezgif.com/

Style guides and cheat sheets

I do not like this English term "cheat sheet" but what can I do, I call those excerpts for myself. 

I do not consider as cheating the use of a clean knowledge extract while working, except in such a situation when it is not allowed, for example on a final / entrance exam. Nowadays the technical knowledge of employees who use computers for a significant part of their worktime to solve their tasks, like IT people / Data Scientist / Data engineers / ... is so wide and deep that I believe no one can have it all in mind. 

Python

Pandas

Jupyter Notebook 

Codecademy

GitHub

Customizong profile readme 

Snowflake universe, part #6 - Forecasting2

Forecasting with built-in ML module Further posts in  Snowflake  topic SnowFlake universe, part#1 SnowFlake, part#2 SnowPark Notebook Snow...