Skip to content

Commit e985569

Browse files
Merge branch 'CodeHarborHub:main' into lc-49
2 parents def4b1c + 0426575 commit e985569

File tree

27 files changed

+3165
-116
lines changed

27 files changed

+3165
-116
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ This project is licensed under the [MIT License](LICENSE).
8585

8686
## Badges
8787

88-
[![DeepSource](https://app.deepsource.com/gh/CodeHarborHub/codeharborhub.github.io.svg/?label=active+issues&show_trend=true&token=D5-vPYsEG8PSYlzqpUGIbsiB)](https://app.deepsource.com/gh/CodeHarborHub/codeharborhub.github.io/) [![DeepSource](https://app.deepsource.com/gh/CodeHarborHub/codeharborhub.github.io.svg/?label=resolved+issues&show_trend=true&token=D5-vPYsEG8PSYlzqpUGIbsiB)](https://app.deepsource.com/gh/CodeHarborHub/codeharborhub.github.io/) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=CodeHarborHub_codeharborhub.github.io&metric=bugs)](https://sonarcloud.io/summary/new_code?id=CodeHarborHub_codeharborhub.github.io) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=CodeHarborHub_codeharborhub.github.io&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=CodeHarborHub_codeharborhub.github.io) [![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=CodeHarborHub_codeharborhub.github.io&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=CodeHarborHub_codeharborhub.github.io) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=CodeHarborHub_codeharborhub.github.io&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=CodeHarborHub_codeharborhub.github.io) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=CodeHarborHub_codeharborhub.github.io&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=CodeHarborHub_codeharborhub.github.io) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=CodeHarborHub_codeharborhub.github.io&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=CodeHarborHub_codeharborhub.github.io) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=CodeHarborHub_codeharborhub.github.io&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=CodeHarborHub_codeharborhub.github.io) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=CodeHarborHub_codeharborhub.github.io&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=CodeHarborHub_codeharborhub.github.io) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=CodeHarborHub_codeharborhub.github.io&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=CodeHarborHub_codeharborhub.github.io) [![DeepScan grade](https://deepscan.io/api/teams/24046/projects/27285/branches/870905/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=24046&pid=27285&bid=870905) [![Docker Image CI](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/docker-image.yml/badge.svg)](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/docker-image.yml) [![Close Old Issues](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/close-old-issue.yml/badge.svg)](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/close-old-issue.yml) [![Close Stale PRs](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/close-old-pr.yml/badge.svg)](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/close-old-pr.yml) [![CodeQL](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/github-code-scanning/codeql) [![Comment on Issue Close](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/autocomment-iss-close.yml/badge.svg)](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/autocomment-iss-close.yml) [![Greetings](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/greetings.yml/badge.svg)](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/greetings.yml) ![GitHub commit activity](https://img.shields.io/github/commit-activity/t/CodeHarborHub/codeharborhub) ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/CodeHarborHub/codeharborhub) ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/CodeHarborHub/codeharborhub) ![GitHub commit activity](https://img.shields.io/github/commit-activity/y/CodeHarborHub/codeharborhub) ![GitHub Org's stars](https://img.shields.io/github/stars/CodeHarborHub%2Fcodeharborhub) ![GitHub License](https://img.shields.io/github/license/CodeHarborHub/codeharborhub) ![GitHub forks](https://img.shields.io/github/forks/CodeHarborHub/codeharborhub) ![GitHub watchers](https://img.shields.io/github/watchers/CodeHarborHub/codeharborhub) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/CodeHarborHub/codeharborhub) ![GitHub file size in bytes](https://img.shields.io/github/size/CodeHarborHub/codeharborhub/docusaurus.config.js) ![GitHub repo file or directory count](https://img.shields.io/github/directory-file-count/CodeHarborHub/codeharborhub) ![GitHub repo size](https://img.shields.io/github/repo-size/CodeHarborHub/codeharborhub)
88+
[![DeepSource](https://app.deepsource.com/gh/CodeHarborHub/codeharborhub.github.io.svg/?label=active+issues&show_trend=true&token=D5-vPYsEG8PSYlzqpUGIbsiB)](https://app.deepsource.com/gh/CodeHarborHub/codeharborhub.github.io/) [![DeepSource](https://app.deepsource.com/gh/CodeHarborHub/codeharborhub.github.io.svg/?label=resolved+issues&show_trend=true&token=D5-vPYsEG8PSYlzqpUGIbsiB)](https://app.deepsource.com/gh/CodeHarborHub/codeharborhub.github.io/) [![DeepScan grade](https://deepscan.io/api/teams/24046/projects/27285/branches/870905/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=24046&pid=27285&bid=870905) [![Docker Image CI](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/docker-image.yml/badge.svg)](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/docker-image.yml) [![Close Old Issues](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/close-old-issue.yml/badge.svg)](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/close-old-issue.yml) [![Close Stale PRs](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/close-old-pr.yml/badge.svg)](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/close-old-pr.yml) [![CodeQL](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/github-code-scanning/codeql) [![Comment on Issue Close](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/autocomment-iss-close.yml/badge.svg)](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/autocomment-iss-close.yml) [![Greetings](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/greetings.yml/badge.svg)](https://github.com/CodeHarborHub/codeharborhub/actions/workflows/greetings.yml) ![GitHub commit activity](https://img.shields.io/github/commit-activity/t/CodeHarborHub/codeharborhub) ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/CodeHarborHub/codeharborhub) ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/CodeHarborHub/codeharborhub) ![GitHub commit activity](https://img.shields.io/github/commit-activity/y/CodeHarborHub/codeharborhub) ![GitHub Org's stars](https://img.shields.io/github/stars/CodeHarborHub%2Fcodeharborhub) ![GitHub License](https://img.shields.io/github/license/CodeHarborHub/codeharborhub) ![GitHub forks](https://img.shields.io/github/forks/CodeHarborHub/codeharborhub) ![GitHub watchers](https://img.shields.io/github/watchers/CodeHarborHub/codeharborhub) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/CodeHarborHub/codeharborhub) ![GitHub file size in bytes](https://img.shields.io/github/size/CodeHarborHub/codeharborhub/docusaurus.config.js) ![GitHub repo file or directory count](https://img.shields.io/github/directory-file-count/CodeHarborHub/codeharborhub) ![GitHub repo size](https://img.shields.io/github/repo-size/CodeHarborHub/codeharborhub)
8989

9090
## Contributors
9191

authors.json

Whitespace-only changes.

community/team.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,4 @@ If you are interested in joining the team, or would like to contribute to the Op
2121

2222
## Contributors {#contributors}
2323

24-
![contributors](https://opencollective.com/codeharborhub/contributors.svg?button=false)
25-
26-
<!--
27-
[![contributors](https://contrib.rocks/image?repo=codeharborhub/codeharborhub)](https://github.com/codeharborhub/codeharborhub/graphs/contributors)
28-
-->
24+
![Contributors](https://opencollective.com/codeharborhub/contributors.svg?button=false&avatarHeight=50&width=1000)

docs/Machine Learning/An-Introduction -to-Machine-Learning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
id: Machine Learning
2+
id: machine-learning
33
title: Introduction to Machine Learning
44
sidebar_label: An Introduction to Machine Learning
55
sidebar_position: 8

docs/python/Scipy.md

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Scipy
2+
3+
Scipy is a powerful Python library used for scientific and technical computing. It builds on NumPy and provides a large number of higher-level functions for mathematical operations, including optimization, integration, interpolation, eigenvalue problems, algebraic equations, and more.
4+
5+
**1. Installation:**
6+
```python
7+
python -m pip install scipy
8+
```
9+
10+
**2. Import and Usage:**
11+
12+
```python
13+
import numpy as np
14+
from scipy import linalg, optimize, integrate, interpolate, stats
15+
```
16+
17+
**3. Linear Algebra:**
18+
19+
Scipy has many functions for linear algebra operations
20+
21+
- Solving Linear Equations:
22+
```python
23+
import numpy as np
24+
from scipy import linalg, optimize, integrate, interpolate, stats
25+
# Solving the system of equations Ax = b
26+
A = np.array([[3, 2], [1, 2]])
27+
b = np.array([2, 0])
28+
29+
x = linalg.solve(A, b)
30+
print(x) # Solution to the system
31+
```
32+
33+
- Eigenvalues and eigenvectors
34+
```python
35+
# Finding eigenvalues and eigenvectors
36+
import numpy as np
37+
from scipy import linalg, optimize, integrate, interpolate, stats
38+
39+
A = np.array([[3, 2], [4, 1]])
40+
41+
eigenvalues, eigenvectors = linalg.eig(A)
42+
print(eigenvalues) # Eigenvalues
43+
print(eigenvectors) # Eigenvectors
44+
```
45+
46+
**4. Optimization:**
47+
48+
- Finding minima of a function:
49+
```python
50+
import numpy as np
51+
from scipy import linalg, optimize, integrate, interpolate, stats
52+
53+
# Minimizing a scalar function
54+
def f(x):
55+
return x**2 + 10*np.sin(x)
56+
57+
result = optimize.minimize(f, x0=0)
58+
print(result.x) # Minimum value of the function
59+
```
60+
61+
- Root Finding
62+
```python
63+
import numpy as np
64+
from scipy import linalg, optimize, integrate, interpolate, stats
65+
66+
# Finding roots of a function
67+
def f(x):
68+
return x**2 - 4
69+
70+
root = optimize.root(f, x0=1)
71+
print(root.x) # Root of the function
72+
```
73+
74+
**5. Interpolation:**
75+
76+
Interpolation can be useful when you want to estimate values between known data points.
77+
78+
```python
79+
import numpy as np
80+
from scipy import linalg, optimize, integrate, interpolate, stats
81+
82+
# Interpolating data
83+
x = np.linspace(0, 10, 10)
84+
y = np.sin(x)
85+
86+
f = interpolate.interp1d(x, y)
87+
x_new = np.linspace(0, 10, 50)
88+
y_new = f(x_new)
89+
90+
print(y_new) # Interpolated values
91+
```
92+
93+
**6. Statistics:**
94+
95+
Scipy's `stats` module provides a range of statistical functions.
96+
97+
```python
98+
import numpy as np
99+
from scipy import linalg, optimize, integrate, interpolate, stats
100+
101+
102+
# Calculating descriptive statistics
103+
data = np.random.normal(loc=0, scale=1, size=1000)
104+
105+
mean = stats.tmean(data)
106+
std_dev = stats.tstd(data)
107+
108+
print(mean) # Mean of the data
109+
print(std_dev) # Standard deviation of the data
110+
```
111+
112+
113+
**7. Signal Processing:**
114+
115+
Scipy's `signal` module is a powerful tool for signal processing tasks in Python. It provides functions for filtering, spectral analysis, interpolation, and other signal-related operations.
116+
117+
- Filtering:
118+
119+
```python
120+
from scipy import signal
121+
import numpy as np
122+
import matplotlib.pyplot as plt
123+
124+
# Generate a noisy signal
125+
np.random.seed(0)
126+
t = np.linspace(0, 1, 1000)
127+
x = np.sin(2 * np.pi * 10 * t) + np.random.normal(0, 1, t.shape)
128+
129+
# Design a low-pass FIR filter
130+
b = signal.firwin(30, 0.05)
131+
x_filtered = signal.lfilter(b, 1, x)
132+
133+
# Plotting
134+
plt.figure(figsize=(10, 4))
135+
plt.plot(t, x, label='Noisy signal')
136+
plt.plot(t, x_filtered, label='Filtered signal')
137+
plt.xlabel('Time')
138+
plt.ylabel('Amplitude')
139+
plt.legend()
140+
plt.show()
141+
```
142+
143+
Output:
144+
145+
![image](https://github.com/AmrutaJayanti/codeharborhub/assets/142327526/63a9d70a-af17-414b-beb4-563832da68d5)
146+
147+
148+
- Spectral Analysis:
149+
150+
```python
151+
from scipy import signal
152+
import numpy as np
153+
import matplotlib.pyplot as plt
154+
155+
156+
# Compute and plot a spectrogram
157+
f, t, Sxx = signal.spectrogram(x, fs=1000)
158+
plt.figure(figsize=(10, 4))
159+
plt.pcolormesh(t, f, 10 * np.log10(Sxx), shading='gouraud')
160+
plt.ylabel('Frequency [Hz]')
161+
plt.xlabel('Time [sec]')
162+
plt.colorbar(label='Power [dB]')
163+
plt.show()
164+
```
165+
166+
Output:
167+
168+
![image](https://github.com/AmrutaJayanti/codeharborhub/assets/142327526/30e09ff7-3ad0-424e-993d-96825ad44fb1)
169+
170+
171+
172+

docusaurus.config.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ const config = {
3939
keywords: ["my-custom-admonition"],
4040
extendDefaults: true,
4141
},
42-
editUrl: "https://github.com/codeharborhub/codeharborhub.github.io/edit/main/",
42+
editUrl:
43+
"https://github.com/codeharborhub/codeharborhub.github.io/edit/main/",
4344
remarkPlugins: [remarkMath],
4445
rehypePlugins: [rehypeKatex],
4546
},
@@ -48,7 +49,8 @@ const config = {
4849
},
4950
blog: {
5051
showReadingTime: true,
51-
editUrl: "https://github.com/codeharborhub/codeharborhub.github.io/edit/main/",
52+
editUrl:
53+
"https://github.com/codeharborhub/codeharborhub.github.io/edit/main/",
5254
remarkPlugins: [[npm2yarn, { converters: ["pnpm"] }]],
5355
},
5456
theme: {
@@ -170,44 +172,41 @@ const config = {
170172
html: '<span class="nav-emoji">🤝</span> Community',
171173
position: "left",
172174
},
175+
173176
{
174-
html: '<span class="nav-emoji"> 📊</span> Quiz',
175-
to: "https://quiz-app-ajay-dhangar.vercel.app/",
176-
},
177-
{
178-
html: '<span class="nav-emoji"> 📺</span> Broadcast',
179-
to: "https://codeharborhub-broadcast-web.vercel.app/",
177+
to: "/our-sponsors/",
178+
html: '<span class="nav-emoji">💰</span> Donate'
180179
},
181180

182181
{
183182
to: "/blog",
184183
html: '<span class="nav-emoji">📰</span> Blog',
185184
},
185+
186186
{
187187
type: "dropdown",
188-
html: '<span class="nav-emoji">🏷️</span> Tags',
188+
html: '<span class="nav-emoji">🔗</span> More',
189189
position: "left",
190190
items: [
191+
{
192+
html: '<span class="nav-emoji"> 📊</span> Quiz',
193+
to: "https://quiz-app-ajay-dhangar.vercel.app/",
194+
},
195+
{
196+
html: '<span class="nav-emoji"> 📺</span> Broadcast',
197+
to: "https://codeharborhub-broadcast-web.vercel.app/",
198+
},
191199
{
192200
label: "🏷️ Tutorial Tags 📚",
193201
to: "/docs/tags/",
194202
activeBaseRegex: "/docs/tags/",
195203
},
196204

197-
{
198-
type: "html",
199-
value: '<hr style="margin: 0.3rem 0;">',
200-
},
201-
202205
{
203206
label: "🏷️ Courses Tags 🎓",
204207
to: "/courses/tags/",
205208
activeBaseRegex: "/courses/tags/",
206209
},
207-
{
208-
type: "html",
209-
value: '<hr style="margin: 0.3rem 0;">',
210-
},
211210

212211
{
213212
label: "🏷️ DSA Tags 🧠",
@@ -216,6 +215,7 @@ const config = {
216215
},
217216
],
218217
},
218+
219219
{
220220
type: "search",
221221
position: "right",
@@ -556,4 +556,4 @@ const config = {
556556
],
557557
};
558558

559-
export default config;
559+
export default config;

0 commit comments

Comments
 (0)