https://github.com/cai991108/python-programming-utils
This repository contains the code and documentation for python utils.
https://github.com/cai991108/python-programming-utils
python-utilities python-utility python-utils
Last synced: 3 months ago
JSON representation
This repository contains the code and documentation for python utils.
- Host: GitHub
- URL: https://github.com/cai991108/python-programming-utils
- Owner: CAI991108
- License: mit
- Created: 2025-01-04T12:38:33.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-04T12:40:50.000Z (5 months ago)
- Last Synced: 2025-01-04T13:44:35.534Z (5 months ago)
- Topics: python-utilities, python-utility, python-utils
- Language: Jupyter Notebook
- Homepage:
- Size: 13.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Programming Utils
This repository contains the code and documentation for python utils. Below is a brief overview of each project and the tasks involved.
**pyutils_1.py** includes:
1. **Jacobian Matrix Calculation**: Implement a function to calculate the Jacobian matrix for a given vector and function.
2. **Emirp Numbers**: Write a program to find and display the first N emirp numbers.
3. **List Operations**: Implement functions to check if a number is exclusively in one of two lists and to crack a four-digit password.
4. **Recursion and Tree Structures**: Implement recursive functions and a binary search tree.
5. **Data Loading and Wrangling**: Load and clean data from a TSV file, perform data analysis, and visualize results.
6. **Stock Data Analysis**: Analyze stock data, calculate moving averages, and implement trading strategies.
7. **KNN Classifier**: Implement a KNN classifier to predict test preparation course status based on reading and writing scores.**pyutils_2.py** includes:
1. **Dictionary Generation**: Generate a dictionary of factorials for numbers from 1 to n.
2. **Iterator Operations**: Implement a function to find the first value in an iterator that appears k times in a row.
3. **Recursive Functions**: Write recursive functions to check for adjacent 5s in a number and to find all ways k positive integers can sum to n.
4. **List Intersection**: Implement a function to find the intersection of elements in a list of lists.
5. **Sandwich Number Check**: Implement a function to check if a number contains a sandwich (a digit surrounded by two identical digits).
6. **Mint and Coin Classes**: Implement classes to simulate a mint that creates coins with specific years and calculates their worth.
7. **Portfolio Management**: Load stock data, calculate expected returns, build a covariance matrix, and design an optimal portfolio allocation.
8. **Risk Analysis**: Calculate and visualize Value at Risk (VaR) and Conditional Value at Risk (CVaR) for a portfolio.
9. **Linear Classification**: Use a linear classifier to predict the status of a test preparation course and evaluate its performance.
10. **Regression Analysis**: Use linear regression to study the trend of reading scores with respect to math scores.
11. **Time Series Analysis**: Perform exploratory data analysis on superstore sales data, including resampling and time shifting.
12. **PyTorch Exercise**: Set up PyTorch CUDA and perform basic operations.To run the code in this repository, you will need:
- Python 3.x, Jupyter Notebook, Required Python libraries (e.g., NumPy, Pandas, Matplotlib, Scikit-learn, PyTorch)
You can install the required libraries using pip:
```bash
pip install numpy pandas matplotlib scikit-learn torch torchvision
```
## License
This project is licensed under the MIT License. See the LICENSE file for details.