diff --git a/index.html b/index.html index 2ed5c62..dd9a960 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,8 @@ - + + PyLibLog diff --git a/src/Python_Library_Pages/Matplotlib/Intro-to-Matplotlib.jsx b/src/Python_Library_Pages/Matplotlib/Intro-to-Matplotlib.jsx index 841fd38..f5cf79b 100644 --- a/src/Python_Library_Pages/Matplotlib/Intro-to-Matplotlib.jsx +++ b/src/Python_Library_Pages/Matplotlib/Intro-to-Matplotlib.jsx @@ -2,7 +2,7 @@ import React from "react"; const MatplotlibBasics = () => { return ( -
+

Introduction to Matplotlib

Development can start for Matplotlib from here

diff --git a/src/Python_Library_Pages/Numpy/Intro-to-Numpy.jsx b/src/Python_Library_Pages/Numpy/Intro-to-Numpy.jsx index 31986e7..6e1faad 100644 --- a/src/Python_Library_Pages/Numpy/Intro-to-Numpy.jsx +++ b/src/Python_Library_Pages/Numpy/Intro-to-Numpy.jsx @@ -2,12 +2,77 @@ import React from "react"; const NumpyBasics = () => { return ( -
-

Introduction to NumPy

+
+

Introduction to NumPy

-

Development can start for NumPy from here

+

+ NumPy, short for Numerical Python, is a fundamental library in the Python ecosystem for numerical and scientific computing. It provides support for large, multi-dimensional arrays and matrices, along with a collection of high-level mathematical functions to operate on these arrays. NumPy is a must-know tool for anyone involved in data analysis, machine learning, scientific research, and more. +

+ +

Why NumPy?

+ +

+ You might be wondering why you should use NumPy when Python itself has a rich set of data structures and functions. Here are some compelling reasons: +

+ +
    +
  • + Efficiency: NumPy is implemented in C, which makes it faster and more efficient than pure Python code. It leverages pre-compiled functions and avoids the overhead of interpreting Python code. +
  • +
  • + Multi-dimensional Arrays: NumPy provides a powerful ndarray data structure, which allows you to work with arrays of any dimension (vectors, matrices, tensors) efficiently. +
  • +
  • + Mathematical Functions: NumPy includes a wide range of mathematical functions, including linear algebra, statistics, Fourier analysis, and more. +
  • +
  • + Broadcasting: NumPy's broadcasting feature allows you to perform operations on arrays of different shapes, making your code more concise and readable. +
  • +
  • + Interoperability: NumPy integrates seamlessly with other scientific libraries in Python, such as SciPy, Matplotlib, and Pandas. +
  • +
+ +

Getting Started

+ +

+ Before you dive into NumPy, you'll need to ensure that Python and NumPy are installed on your system. Let's go through the installation process: +

+ +

Python Installation (if needed)

+

+ If you haven't installed Python, follow these steps to get it up and running on your system: +

+ +
+

For Windows:

+
    +
  1. Visit the official Python website at python.org
  2. +
  3. Navigate to the "Downloads" section.
  4. +
  5. Click on the latest version of Python for Windows.
  6. +
  7. Run the downloaded installer.
  8. +
  9. Check the box that says "Add Python to PATH" during installation.
  10. +
  11. Click "Install Now" to start the installation process.
  12. +
  13. Open a Command Prompt or PowerShell.
  14. +
  15. Type python --version or python -V and press Enter to verify the installation.
  16. +
+
+ +

Installing NumPy

+ +

+ Once Python is installed, it's straightforward to install NumPy. Open your terminal or command prompt and run the following command: +

+ +
+ pip install numpy +
+ +

+ This command will install NumPy on your system. Once NumPy is installed, you're ready to dive into the world of numerical computing with Python. Let's start exploring NumPy and its capabilities! +

); }; -export default NumpyBasics; \ No newline at end of file +export default NumpyBasics; diff --git a/src/Python_Library_Pages/Pandas/Intro-to-Pandas.jsx b/src/Python_Library_Pages/Pandas/Intro-to-Pandas.jsx index 9e2102a..ac0c5ed 100644 --- a/src/Python_Library_Pages/Pandas/Intro-to-Pandas.jsx +++ b/src/Python_Library_Pages/Pandas/Intro-to-Pandas.jsx @@ -2,7 +2,7 @@ import React from "react"; const PandasBasics = () => { return ( -
+

Introduction to Pandas

Development can start for Pandas from here

diff --git a/src/Python_Library_Pages/Python_Basics/Intrduction-to-Operators.jsx b/src/Python_Library_Pages/Python_Basics/Intrduction-to-Operators.jsx index 6d7e607..cd10b64 100644 --- a/src/Python_Library_Pages/Python_Basics/Intrduction-to-Operators.jsx +++ b/src/Python_Library_Pages/Python_Basics/Intrduction-to-Operators.jsx @@ -2,7 +2,7 @@ import React from "react"; const OperatorsBasics = () => { return ( -
+

Introduction to Operators in Python

Development can start for Python from here

diff --git a/src/Python_Library_Pages/Python_Basics/Introduction-to-Functions.jsx b/src/Python_Library_Pages/Python_Basics/Introduction-to-Functions.jsx index 6618568..6ed7b30 100644 --- a/src/Python_Library_Pages/Python_Basics/Introduction-to-Functions.jsx +++ b/src/Python_Library_Pages/Python_Basics/Introduction-to-Functions.jsx @@ -2,7 +2,7 @@ import React from "react"; const FunctionsBasics = () => { return ( -
+

Introduction to Functions in Python

Development can start for Python from here

diff --git a/src/Python_Library_Pages/Python_Basics/Introduction-to-Python.jsx b/src/Python_Library_Pages/Python_Basics/Introduction-to-Python.jsx index 84db2be..bd24750 100644 --- a/src/Python_Library_Pages/Python_Basics/Introduction-to-Python.jsx +++ b/src/Python_Library_Pages/Python_Basics/Introduction-to-Python.jsx @@ -2,45 +2,48 @@ import React from "react"; const PythonBasics = () => { return ( -
+

1. Introduction to Python


-
-        
-          {`Python is a high-level, interpreted programming language known for its readability and simplicity. It:
-  - Supports multiple programming paradigms.
-  - Has a large standard library.
-  - Python is free and easy to learn.
+
+      
+          
+            {`Python is a high-level, interpreted programming language known for its readability and simplicity. It:
+- Supports multiple programming paradigms.
+- Has a large standard library.
+- Python is free and easy to learn.
 
 This doc will help you to get all the knowledge you want for getting started with Python. 
 If you have never programmed anything before and are just getting started, this might be the blog for you. 
 Python has many use cases in different industries such as
 
-  Web Development:
-    - Frameworks like Django and Flask make Python a popular choice for building web applications.
+Web Development:
+  - Frameworks like Django and Flask make Python a popular choice for building web applications.
 
-  Data Science and Machine Learning:
-    - Python is extensively used for data analysis, machine learning, and artificial intelligence.
-    - Libraries such as NumPy, Pandas, Scikit-learn, TensorFlow, and PyTorch are widely employed.
+Data Science and Machine Learning:
+  - Python is extensively used for data analysis, machine learning, and artificial intelligence.
+  - Libraries such as NumPy, Pandas, Scikit-learn, TensorFlow, and PyTorch are widely employed.
 
-  Finance:
-    - Python is used in finance for quantitative analysis, risk management, and algorithmic trading.
-    - Libraries such as Pandas and NumPy are particularly useful in this domain.
+Finance:
+  - Python is used in finance for quantitative analysis, risk management, and algorithmic trading.
+  - Libraries such as Pandas and NumPy are particularly useful in this domain.
 
-  Education:
-    - Python is widely used in teaching programming due to its simplicity.
-    - It's often the first language taught in many computer science courses.
+Education:
+  - Python is widely used in teaching programming due to its simplicity.
+  - It's often the first language taught in many computer science courses.
+
+Game Development:
+  - Python is used in the game development industry, and libraries like Pygame make it 
+    easier to develop 2D games.
+
+GIS (Geographic Information System):
+  - Python is used for GIS applications, and libraries like Geopandas and ArcPy are popular 
+    in this field.`}
+          
+        
- Game Development: - - Python is used in the game development industry, and libraries like Pygame make it - easier to develop 2D games. - GIS (Geographic Information System): - - Python is used for GIS applications, and libraries like Geopandas and ArcPy are popular - in this field.`} -
-


diff --git a/src/Python_Library_Pages/TensorFlow/Introduction-to-tensorFlow.jsx b/src/Python_Library_Pages/TensorFlow/Introduction-to-tensorFlow.jsx index a1f5091..68d10cf 100644 --- a/src/Python_Library_Pages/TensorFlow/Introduction-to-tensorFlow.jsx +++ b/src/Python_Library_Pages/TensorFlow/Introduction-to-tensorFlow.jsx @@ -2,7 +2,7 @@ import React from 'react' const TensorFlow = () => { return ( -
+

Introduction-to-tensorFlow

@@ -128,7 +128,7 @@ const TensorFlow = () => { Note: Make sure your system is up to date:

For installation of tensorFlow Open cmd (cammand prompt) and type following cammand...

-
+

pip install tensorflow


@@ -137,12 +137,12 @@ const TensorFlow = () => {

Note: Make sure your system is up to date:

-
+

pip install tensorflow


3. Installing on macOS:

-
+

pip install tensorflow

NOTE: Cammand is same for every OS Only what you need to check is your python version .

@@ -159,7 +159,7 @@ const TensorFlow = () => {

Tensors of rank 0 are scalars. They have no dimensions and represent single values. In TensorFlow, you can create a scalar tensor like this:


-
+

import tensorflow as tf

scalar_tensor = tf.constant(5)

@@ -168,7 +168,7 @@ const TensorFlow = () => {

Tensors of rank 1 are vectors. They have one dimension and can be considered as an array of values.


-
+

vector_tensor = tf.constant([1, 2, 3, 4, 5])



@@ -176,7 +176,7 @@ const TensorFlow = () => {

Tensors of rank 2 are matrices. They have two dimensions, representing rows and columns. For example:


-
+

matrix_tensor = tf.constant([[1, 2, 3], [4, 5, 6]])


@@ -184,7 +184,7 @@ const TensorFlow = () => {

Tensors can have more than two dimensions. For instance, a rank-3 tensor could represent a cube of values, and a rank-4 tensor could represent a hyperspace.


-
+

rank_3_tensor = tf.constant([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])

rank_4_tensor = tf.constant([[[[1, 2], [3, 4]], [[5, 6], [7, 8]]], [[[9, 10], [11, 12]], [[13, 14], [15, 16]]]])


@@ -193,7 +193,7 @@ const TensorFlow = () => {

Tensors can hold data of different types, such as tf.float32, tf.int32, and more. You can specify the data type when creating a tensor.


-
+

float_tensor = tf.constant(3.14, dtype=tf.float32)

int_tensor = tf.constant(42, dtype=tf.int32)

@@ -202,7 +202,7 @@ const TensorFlow = () => {

TensorFlow provides a wide range of operations to manipulate tensors, including element-wise operations, matrix operations, and more complex operations for building and training machine learning models.


-
+

tensor_a = tf.constant([1, 2, 3])

tensor_b = tf.constant([4, 5, 6])

result_tensor = tf.add(tensor_a, tensor_b)

@@ -212,7 +212,7 @@ const TensorFlow = () => {

The shape of a tensor describes its dimensions. You can access the shape of a tensor using the .shape attribute.


-
+

shape = tensor_a.shape # Returns the shape of tensor_a


@@ -220,7 +220,7 @@ const TensorFlow = () => {

You can change the shape of a tensor using the tf.reshape function. This is useful when you need to convert a tensor from one shape to another.


-
+

reshaped_tensor = tf.reshape(matrix_tensor, [3, 2]) # Reshapes a 2x3 matrix to a 3x2 matrix


@@ -228,7 +228,7 @@ const TensorFlow = () => {

You can create tensors using tf.constant for constant values, and tf.Variable for mutable tensors that can be updated during training.


-
+

constant_tensor = tf.constant([1, 2, 3])

variable_tensor = tf.Variable([4, 5, 6])

@@ -243,7 +243,7 @@ const TensorFlow = () => {

1. Import TensorFlow :

Import TensorFlow: To use TensorFlow, you need to import it at the beginning of your Python script or notebook.

-
+

import tensorflow as tf

@@ -252,7 +252,7 @@ const TensorFlow = () => {

To create a TensorFlow variable, you can use the tf.Variable() constructor. You typically initialize variables with initial values

-
+

initial_value = tf.constant([1.0, 2.0, 3.0])

my_variable = tf.Variable(initial_value)

@@ -266,7 +266,7 @@ const TensorFlow = () => {

Variables are typically updated during training to optimize a model's parameters. You can use operations like assign() and assign_add() to change the value of a variable.

-
+

updated_value = my_variable.assign([4.0, 5.0, 6.0])


@@ -274,7 +274,7 @@ const TensorFlow = () => {

TensorFlow allows you to group variables into collections. This can be helpful when saving or loading models. You can add variables to collections using `tf.add_to_collection()`.

-
+

tf.add_to_collection('my_variables', my_variable)


@@ -282,7 +282,7 @@ const TensorFlow = () => {

You can save and restore variables using TensorFlow's `tf.train.Saver`. This is useful for checkpointing your model's progress during training and for deploying trained models.

-
+

saver = tf.train.Saver()

saver.save(sess, "my_model.ckpt")

# Later, restore the model @@ -293,7 +293,7 @@ const TensorFlow = () => {

You can specify where you want to place a variable, either on a CPU or a GPU. This can be done using the `device` argument when creating the variable.

-
+

with tf.device('/gpu:0'):

gpu_variable = tf.Variable([1.0, 2.0, 3.0])

@@ -302,7 +302,7 @@ const TensorFlow = () => {

You can use variable scopes to organize variables and manage their names. This can help with debugging and readability.

-
+

with tf.variable_scope('my_scope'):

scoped_variable = tf.Variable(0.0)

@@ -311,7 +311,7 @@ const TensorFlow = () => {

In TensorFlow 2.x, eager execution is enabled by default, which means you can manipulate variables just like any other Python objects without the need for a session. Eager execution makes TensorFlow code more intuitive and Pythonic.

-
+

tf.config.run_functions_eagerly(True) # Eager execution is enabled by default in TF 2.x


@@ -319,7 +319,7 @@ const TensorFlow = () => {

TensorFlow Variables are tracked as resource objects and have built-in memory management and device placement.

-
+

with tf.device('/gpu:0'):

var = tf.Variable(0.0)

diff --git a/src/index.css b/src/index.css index 1a907e1..ed1f333 100644 --- a/src/index.css +++ b/src/index.css @@ -25,3 +25,14 @@ .active { @apply bg-blue-100 text-blue-600; } + +.sidebart { + position: fixed !important ; +} + + +@media (max-width: 768px) { + body { + overflow: auto; + } +} diff --git a/src/layouts/RootLayout.jsx b/src/layouts/RootLayout.jsx index 9844e5c..2c34072 100644 --- a/src/layouts/RootLayout.jsx +++ b/src/layouts/RootLayout.jsx @@ -2,9 +2,12 @@ import Sidebar from "./sidebar"; function RootLayout({ children }) { return ( -
- -
{children}
+
+
+ +
+ +
{children}
); } diff --git a/src/layouts/sidebar/index.jsx b/src/layouts/sidebar/index.jsx index d7a2e98..93943ad 100644 --- a/src/layouts/sidebar/index.jsx +++ b/src/layouts/sidebar/index.jsx @@ -59,15 +59,34 @@ const Sidebar = () => { transition: { damping: 40, }, - }, - }; + }; + // subMenusList.map(menu => { + // console.log(menu); + // }) + + useEffect(() => { + if (window.innerWidth <= 768) { + if (open) { + document.body.style.overflow = "hidden"; // Disable scrolling on the body + } else { + document.body.style.overflow = "auto"; // Enable scrolling on the body + } + + return () => { + document.body.style.overflow = "auto"; // Ensure scrolling is re-enabled on unmount + }; + } + }, [open]); return ( -
+
setOpen(false)} - className={`md:hidden fixed inset-0 max-h-screen z-[998] bg-black/50 ${open ? "block" : "hidden" - } `} + + className={`md:hidden fixed inset-0 overflow-hidden z-[998] bg-black/50 ${ + open ? "block" : "hidden" + } `} + >
{ initial={{ x: isTabletMid ? -250 : 0 }} animate={open ? "open" : "closed"} // sidebar color code (#E0E0E0) - className="border-r border-[#BFC9CA] shadow-lg bg-[#EAEDED] text-black text-[16px] shadow-xl z-[999] max-w-[19rem] w-[19rem] overflow-hidden md:relative fixed h-screen" + className="border-r border-[#BFC9CA] bg-[#EAEDED] text-black text-[16px] shadow-xl z-[999] max-w-[19rem] w-[19rem] md:relative overflow-y-scroll scrollbar-thin fixed h-screen" style={{ fontFamily: "Poppins, sans-serif", fontWeight: "light" }} > -
+
{/* {
+
+
+
-
-