Data Science Machine Learning Data Analysis
38.9K subscribers
3.71K photos
31 videos
39 files
1.28K links
ads: @HusseinSheikho

This channel is for Programmers, Coders, Software Engineers.

1- Data Science
2- Machine Learning
3- Data Visualization
4- Artificial Intelligence
5- Data Analysis
6- Statistics
7- Deep Learning
Download Telegram
python_basics.pdf
212.3 KB
๐Ÿš€ Master Python with Ease!

I've just compiled a set of clean and powerful Python Cheat Sheets to help beginners and intermediates speed up their coding workflow.

Whether you're brushing up on the basics or diving into data science, these sheets will save you time and boost your productivity.

๐Ÿ“Œ Topics Covered:
Python Basics
Jupyter Notebook Tips
Importing Libraries
NumPy Essentials
Pandas Overview

Perfect for students, developers, and anyone looking to keep essential Python knowledge at their fingertips.

#Python #CheatSheets #PythonTips #DataScience #JupyterNotebook #NumPy #Pandas #MachineLearning #AI #CodingTips #PythonForBeginners

๐ŸŒŸ Join the communities:
โœ‰๏ธ Our Telegram channels: https://t.iss.one/addlist/0f6vfFbEMdAwODBk

๐Ÿ“ฑ Our WhatsApp channel: https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Please open Telegram to view this post
VIEW IN TELEGRAM
โค9๐Ÿ‘6๐Ÿ”ฅ1
segment = sine_wave[0:51]
windowed_segment = segment * window


VI. Convolution & Correlation

โ€ข Perform linear convolution.
sig1 = np.repeat([0., 1., 0.], 100)
sig2 = np.repeat([0., 1., 1., 0.], 100)
convolved = signal.convolve(sig1, sig2, mode='same')

โ€ข Compute cross-correlation.
# Useful for finding delays between signals
correlation = signal.correlate(sig1, sig2, mode='full')

โ€ข Compute auto-correlation.
# Useful for finding periodicities in a signal
autocorr = signal.correlate(sine_wave, sine_wave, mode='full')


VII. Time-Frequency Analysis

โ€ข Compute and plot a spectrogram.
f, t_spec, Sxx = signal.spectrogram(chirp_signal, fs)
plt.pcolormesh(t_spec, f, Sxx, shading='gouraud')
plt.show()

โ€ข Perform Continuous Wavelet Transform (CWT).
widths = np.arange(1, 31)
cwt_matrix = signal.cwt(chirp_signal, signal.ricker, widths)

โ€ข Perform Hilbert transform to get the analytic signal.
analytic_signal = signal.hilbert(sine_wave)

โ€ข Calculate instantaneous frequency.
instant_phase = np.unwrap(np.angle(analytic_signal))
instant_freq = (np.diff(instant_phase) / (2.0*np.pi) * fs)


VIII. Feature Extraction

โ€ข Find peaks in a signal.
peaks, _ = signal.find_peaks(sine_wave, height=0.5)

โ€ข Find peaks with prominence criteria.
peaks_prom, _ = signal.find_peaks(noisy_signal, prominence=1)

โ€ข Differentiate a signal (e.g., to find velocity from position).
derivative = np.diff(sine_wave)

โ€ข Integrate a signal.
from scipy.integrate import cumulative_trapezoid
integral = cumulative_trapezoid(sine_wave, t, initial=0)

โ€ข Detrend a signal to remove a linear trend.
trend = np.linspace(0, 1, fs)
trended_signal = sine_wave + trend
detrended = signal.detrend(trended_signal)


IX. System Analysis

โ€ข Define a system via a transfer function (numerator, denominator).
# Example: 2nd order low-pass filter
system = signal.TransferFunction([1], [1, 1, 1])

โ€ข Compute the step response of a system.
t_step, y_step = signal.step(system)

โ€ข Compute the impulse response of a system.
t_impulse, y_impulse = signal.impulse(system)

โ€ข Compute the Bode plot of a system's frequency response.
w, mag, phase = signal.bode(system)


X. Signal Generation from Data

โ€ข Generate a signal from a function.
t = np.linspace(0, 1, 500)
custom_signal = np.sinc(2 * np.pi * 4 * t)

โ€ข Convert a list of values to a signal array.
my_data = [0, 1, 2, 3, 2, 1, 0, -1, -2, -1, 0]
data_signal = np.array(my_data)

โ€ข Read signal data from a WAV file.
from scipy.io import wavfile
samplerate, data = wavfile.read('audio.wav')

โ€ข Create a pulse train signal.
pulse_train = np.zeros(fs)
pulse_train[::100] = 1 # Impulse every 100 samples


#Python #SignalProcessing #SciPy #NumPy #DSP

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
By: @DataScienceM โœจ
๐Ÿ“Œ NumPy for Absolute Beginners: A Project-Based Approach to Data Analysis

๐Ÿ—‚ Category: DATA SCIENCE

๐Ÿ•’ Date: 2025-11-04 | โฑ๏ธ Read time: 14 min read

Master NumPy for data analysis with this project-based guide for absolute beginners. Learn to build a high-performance sensor data pipeline from scratch and unlock the true speed of Python for data-intensive applications.

#NumPy #Python #DataAnalysis #DataScience