-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jay
authored and
Jay
committed
Sep 30, 2024
1 parent
c8acc25
commit 85a7fea
Showing
11 changed files
with
1,177 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM mcr.microsoft.com/vscode/devcontainers/universal:2-focal | ||
|
||
# Execute files when main is triggered | ||
RUN apt-get update && apt-get -y install --no-install-recommends \ | ||
python3.8-venv \ | ||
gcc | ||
|
||
# Setting up virtual environment | ||
ARG USER="codespace" | ||
ARG VENV_PATH="/home/${USER}/venv" | ||
COPY requirements.txt /tmp/ | ||
COPY Makefile /tmp/ | ||
# Install packages according to the versions listed in the requirements.txt file | ||
RUN su $USER -c "/usr/bin/python3 -m venv /home/${USER}/venv" \ | ||
&& su $USER -c "${VENV_PATH}/bin/pip --disable-pip-version-check --no-cache-dir install -r /tmp/requirements.txt" \ | ||
# Removes the requirements.txt file from /tmp/ | ||
&& rm -rf /tmp/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,69 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/python | ||
//Set up development environment in Github Codespace | ||
{ | ||
"name": "Python 3", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye" | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "pip3 install --user -r requirements.txt", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} | ||
"name": "GitHub Codespaces (Default)", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": ".." | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/nvidia-cuda:1": { | ||
"installCudnn": true | ||
} | ||
}, | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
// Configure properties specific to VS Code. | ||
"vscode": { | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"go.toolsManagement.checkForUpdates": "local", | ||
"go.useLanguageServer": true, | ||
"go.gopath": "/go", | ||
"python.defaultInterpreterPath": "/home/codespace/venv/bin/python", | ||
"python.linting.enabled": true, | ||
"python.linting.pylintEnabled": true, | ||
"python.formatting.autopep8Path": "/home/codespace/venv/bin/autopep8", | ||
"python.formatting.blackPath": "/home/codespace/venv/bin/black", | ||
"python.formatting.yapfPath": "/home/codespace/venv/bin/yapf", | ||
"python.linting.banditPath": "/home/codespace/venv/bin/bandit", | ||
"python.linting.flake8Path": "/home/codespace/venv/bin/flake8", | ||
"python.linting.mypyPath": "/home/codespace/venv/bin/mypy", | ||
"python.linting.pycodestylePath": "/home/codespace/venv/bin/pycodestyle", | ||
"python.linting.pydocstylePath": "/home/codespace/venv/bin/pydocstyle", | ||
"python.linting.pylintPath": "/home/codespace/venv/bin/pylint", | ||
"lldb.executable": "/usr/bin/lldb", | ||
"files.watcherExclude": { | ||
"**/target/**": true | ||
} | ||
}, | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"GitHub.vscode-pull-request-github", | ||
"GitHub.copilot-nightly", | ||
"GitHub.copilot-labs", | ||
"ms-azuretools.vscode-docker", | ||
"ms-toolsai.jupyter", | ||
"ms-toolsai.jupyter-keymap", | ||
"ms-toolsai.jupyter-renderers", | ||
"ms-python.vscode-pylance", | ||
"ms-python.python", | ||
"ms-vscode.makefile-tools" | ||
] | ||
} | ||
}, | ||
"remoteUser": "codespace", | ||
"overrideCommand": false, | ||
//Docker volumes to be mounted from the Docker | ||
"mounts": [ | ||
"source=codespaces-linux-var-lib-docker,target=/var/lib/docker,type=volume" | ||
], | ||
"runArgs": [ | ||
"--cap-add=SYS_PTRACE", | ||
"--security-opt", | ||
"seccomp=unconfined", | ||
"--privileged", | ||
"--init" | ||
], | ||
//runs the setup.sh file script | ||
"postCreateCommand": "bash setup.sh" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
[](https://github.com/jayliu1016/jayliu_ids_de_1/actions/workflows/hello.yml) | ||
|
||
# jayliu_ids_de_1 | ||
# jayliu_ids_Matrix_Build | ||
python project | ||
It is a template for my future python project. | ||
|
||
<img width="1096" alt="Screenshot 2024-09-06 at 12 23 02 PM" src="https://github.com/user-attachments/assets/9c7c03b7-05ef-4086-8668-8181b2c95cb7"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,37 @@ | ||
import math | ||
import pandas as pd | ||
import matplotlib.pyplot as plt | ||
|
||
def add(x,y): | ||
return math.ceil(x)+math.floor(y) | ||
# Load the player overview dataset | ||
soccer_df = pd.read_csv("player_overview.csv") | ||
|
||
|
||
# print the head of the dataset to showcase what variables it includes | ||
def print_head(): | ||
soccer_head = soccer_df.head() | ||
print(soccer_head) | ||
return soccer_head | ||
|
||
|
||
# describe the dataset's statistics for all numerical columns | ||
def describe_stat(): | ||
# This will include statistics like mean, median, std for all numerical columns | ||
soccer_desc = soccer_df.describe(include=[float, int]) | ||
print(soccer_desc) | ||
return soccer_desc | ||
|
||
|
||
# create a scatter plot of the 'Goals' and 'Assists' columns | ||
def build_scatter_plot(): | ||
plt.scatter(soccer_df['Goals'], soccer_df['Assists'], alpha=0.6, color='blue') | ||
plt.xlabel('Goals') | ||
plt.ylabel('Assists') | ||
plt.title('Scatter Plot of Goals vs Assists') | ||
plt.savefig("Goals_Assists_Scatter.png") | ||
plt.show() | ||
|
||
|
||
# main to execute the functions | ||
if __name__ == "__main__": | ||
print_head() | ||
describe_stat() | ||
build_scatter_plot() |
Oops, something went wrong.