Can anyone give advice for my cousin?

I am asking you guys since I'm not really good enough at maths to help but he told me something about being stuck on dot product and said it was linear algebra so I thought posting here would be good

reddit.com
u/Jotaroisgoat — 25 days ago
▲ 2 r/Gifted

Is chatgpt a good teacher or is my cousin gifted?

A cousin of mine, 11 years old was doing his first year 7 homework about like some maths about me homework - nothing crazy. But somehow in like an hour of research chat taught him factorial, double factorial, functions, log and how to calculate slopes is he just smart or is chatgpt a good teacher

EDIT: He only did it for roughly 1 hour, so he only had a basic understanding no crazy stuff

reddit.com
u/Jotaroisgoat — 1 month ago
▲ 3 r/TheMachineLearning+2 crossposts

Good scikit-learn tutorials (Youtube)

Hi guys, I am a new coder (3 weeks - 1 month) and I am interested in learning scikit-learn (I have already learnt intermediate python, numpy, pandas and matplotlib so does anyone know any 3-6 hour tutorials for sci-kit learn on youtube?

Thanks!

reddit.com
u/Jotaroisgoat — 2 months ago

Pandas mini project! Rate out of 10 (1hr of pandas)

I like pandas so much more than numpy ok but heres the project:

import pandas as pd

book_data = ({"Name:": ["The Hobbit", "Refugee Boy", "Harry Potter and the Philosopher's Stone", "The Hunger Games", "I, Robot"],
              "Pages:": [310, 288, 223, 374, 224],
              "Author:": ["J.R.R. Tolkien", "Benjamin Zephaniah", "J.K. Rowling", "Suzanne Collins", "Isaac Asimov"],
              "Price:": ["£8.35", "£7.99", "£6.00", "£8.99", "£6.62"],
              "Buy:": ["https://amazon.co.uk/dp/0261102214", "https://amazon.co.uk/s?k=Refugee+Boy+Benjamin+Zephaniah",
                       "https://amazon.co.uk/s?k=HP+Philosopher%27s+Stone", "https://amazon.co.uk/s?k=Hunger+Games",
                       "https://amazon.co.uk/dp/0008279551"]})

book_df = pd.DataFrame(book_data, index=["Book 1", "Book 2", "Book 3", "Book 4", "Book 5"])


while True:
    try:
        book_num = int(input("Enter a book number (1-5): "))
    except ValueError:
        print("Invalid Book Number")
        continue

    if book_num < 1 or book_num > 5:
        print("Invalid Book Number")
        continue
    elif book_num == 1:
        print("\n", book_df.iloc[0])
    elif book_num == 2:
        print("\n",book_df.iloc[1])
    elif book_num == 3:
        print("\n",book_df.iloc[2])
    elif book_num == 4:
        print("\n",book_df.iloc[3])
    elif book_num == 5:
        print("\n",book_df.iloc[4])
reddit.com
u/Jotaroisgoat — 2 months ago

I've been learning numpy for 2 days rate my project out of 10

import numpy as np

rng = np.random.default_rng()

numbers = rng.integers(low=1, high=1000, size=(3,3))

print(numbers)

print("\nMinimum:", np.min(numbers))
print("Maximum:", np.max(numbers))
print("Median:",np.median(numbers))
print("Mean:", np.round(np.mean(numbers), 2))
print("Standard Deviation:", np.round(np.std(numbers), 2))
print("Variance:", np.round(np.var(numbers), 2))
print("Sum:", np.sum(numbers))
print("Axis Columns:", np.sum(numbers, axis=0))
print("Axis Rows:", np.sum(numbers, axis=1))
reddit.com
u/Jotaroisgoat — 2 months ago

Rate my code out of 10 for someone who's been coding for 3 weeks :)

import sys

from PyQt6.QtWidgets import (
    QApplication,
    QWidget,
    QPushButton,
    QGridLayout,
    QMainWindow, QLabel,

)
from PyQt6.QtCore import Qt

class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.is_x = True
        self.setWindowTitle("Tic Tac Toe")
        self.label = QLabel("Player 1's Turn:",self)
        self.replays = QPushButton("Replay", self)
        self.button1 = QPushButton("", self)
        self.button2 = QPushButton("", self)
        self.button3 = QPushButton("", self)
        self.button4 = QPushButton("", self)
        self.button5 = QPushButton("", self)
        self.button6 = QPushButton("", self)
        self.button7 = QPushButton("", self)
        self.button8 = QPushButton("", self)
        self.button9 = QPushButton("", self)
        self.replay_connecter()
        self.setGeometry(700,300,500,500)
        self.initUI()


    def initUI(self):

        central_widget = QWidget()
        self.setCentralWidget(central_widget)
        self.label.setGeometry(225, 0, 150, 25)
        self.replays.setStyleSheet("font-size: 35px;"
                                   "font-weight: bold;"
                                   "border-radius: 10px;"
                                   "border: 3px solid black;")
        self.label.setStyleSheet("font-size: 40px;"
                                 "font-weight: bold;"
                                 "border: 3px solid black;"
                                 "border-radius: 10px;")
        self.button1.setStyleSheet("font-size: 80px;"
                                   "border: 5px solid black;")
        self.button2.setStyleSheet("font-size: 80px;"
                                   "border: 5px solid black;")
        self.button3.setStyleSheet("font-size: 80px;"
                                   "border: 5px solid black;")
        self.button4.setStyleSheet("font-size: 80px;"
                                   "border: 5px solid black;")
        self.button5.setStyleSheet("font-size: 80px;"
                                   "border: 5px solid black;")
        self.button6.setStyleSheet("font-size: 80px;"
                                   "border: 5px solid black;")
        self.button7.setStyleSheet("font-size: 80px;"
                                   "border: 5px solid black;")
        self.button8.setStyleSheet("font-size: 80px;"
                                   "border: 5px solid black;")
        self.button9.setStyleSheet("font-size: 80px;"
                                   "border: 5px solid black;")


        grid = QGridLayout()
        grid.addWidget(self.button1, 0, 0)
        grid.addWidget(self.button2, 0, 1)
        grid.addWidget(self.button3, 0, 2)
        grid.addWidget(self.button4, 1, 0)
        grid.addWidget(self.button5, 1, 1)
        grid.addWidget(self.button6, 1, 2)
        grid.addWidget(self.button7, 2, 0)
        grid.addWidget(self.button8, 2, 1)
        grid.addWidget(self.button9, 2, 2)
        grid.addWidget(self.replays, 4, 0, 1, 3)
        grid.addWidget(self.label, 3, 0, 1, 3)

        central_widget.setLayout(grid)

        self.button1.clicked.connect(self.activate1)
        self.button2.clicked.connect(self.activate1)
        self.button3.clicked.connect(self.activate1)
        self.button4.clicked.connect(self.activate1)
        self.button5.clicked.connect(self.activate1)
        self.button6.clicked.connect(self.activate1)
        self.button7.clicked.connect(self.activate1)
        self.button8.clicked.connect(self.activate1)
        self.button9.clicked.connect(self.activate1)

    def activate1(self):
        button = self.sender()

        if self.is_x:
            button.setText("X")
            self.is_x = False
            self.label.setText("Player 2's Turn:")
        else:
            button.setText("O")
            self.is_x = True
            self.label.setText("Player 1's Turn:")

        self.win()

    def win(self):
        if (self.button1.text() == "X" and
                self.button2.text() == "X" and
                self.button3.text() == "X"):
            self.button1.setText("P1")
            self.button2.setText("You")
            self.button3.setText("Win")
        elif (self.button1.text() == "O" and
                self.button2.text() == "O" and
                self.button3.text() == "O"):
            self.button1.setText("P2")
            self.button2.setText("You")
            self.button3.setText("Win")
        elif (self.button7.text() == "X" and
                self.button8.text() == "X" and
        self.button9.text() == "X"):
            self.button7.setText("P1")
            self.button8.setText("You")
            self.button9.setText("Win")
        elif (self.button7.text() == "O" and
                self.button8.text() == "O" and
        self.button9.text() == "O"):
            self.button7.setText("P2")
            self.button8.setText("You")
            self.button9.setText("Win")
        elif (self.button4.text() == "X" and
              self.button5.text() == "X" and
              self.button6.text() == "X"):
            self.button4.setText("P1")
            self.button5.setText("You")
            self.button6.setText("Win")
        elif (self.button4.text() == "O" and
              self.button5.text() == "O" and
              self.button6.text() == "O"):
            self.button4.setText("P2")
            self.button5.setText("You")
            self.button6.setText("Win")
        elif (self.button1.text() == "X" and
              self.button4.text() == "X" and
              self.button7.text() == "X"):
            self.button1.setText("P1")
            self.button4.setText("You")
            self.button7.setText("Win")
        elif (self.button1.text() == "O" and
              self.button4.text() == "O" and
              self.button7.text() == "O"):
            self.button1.setText("P2")
            self.button4.setText("You")
            self.button7.setText("Win")
        elif (self.button2.text() == "X" and
              self.button5.text() == "X" and
              self.button8.text() == "X"):
            self.button2.setText("P1")
            self.button5.setText("You")
            self.button8.setText("Win")
        elif (self.button2.text() == "O" and
        self.button5.text() == "O" and
        self.button8.text() == "O"):
            self.button2.setText("P2")
            self.button5.setText("You")
            self.button8.setText("Win")
        elif (self.button3.text() == "X" and
              self.button6.text() == "X" and
              self.button9.text() == "X"):
            self.button3.setText("P1")
            self.button6.setText("You")
            self.button9.setText("Win")
        elif (self.button3.text() == "O" and
        self.button6.text() == "O" and
              self.button9.text() == "O"):
            self.button3.setText("P2")
            self.button6.setText("You")
            self.button9.setText("Win")
        elif (self.button1.text() == "X" and
              self.button5.text() == "X" and
              self.button9.text() == "X"):
            self.button1.setText("P1")
            self.button5.setText("You")
            self.button9.setText("Win")
        elif (self.button1.text() == "O" and
        self.button5.text() == "O" and
        self.button9.text() == "O"):
            self.button1.setText("P2")
            self.button5.setText("You")
            self.button9.setText("Win")
        elif (self.button3.text() == "X" and
              self.button5.text() == "X" and
              self.button7.text() == "X"):
            self.button3.setText("P1")
            self.button5.setText("You")
            self.button7.setText("Win")
        elif (self.button3.text() == "O" and
        self.button5.text() == "O" and
              self.button7.text() == "O"):
            self.button3.setText("P2")
            self.button5.setText("You")
            self.button7.setText("Win")


    def replay_connecter(self):
        self.replays.clicked.connect(self.replay)

    def replay(self):
        self.button1.setText("")
        self.button2.setText("")
        self.button3.setText("")
        self.button4.setText("")
        self.button5.setText("")
        self.button6.setText("")
        self.button7.setText("")
        self.button8.setText("")
        self.button9.setText("")





if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = MainWindow()
    window.show()
    sys.exit(app.exec())
reddit.com
u/Jotaroisgoat — 2 months ago