Compare commits

...

25 Commits

Author SHA1 Message Date
8f50cee48b Merge branch 'master' of https://gitea.lachscloud.com/Jordi/FH 2025-02-14 08:05:26 +01:00
42b3b2891c a
a
2025-02-14 08:05:24 +01:00
c3a717ccbe a 2025-02-14 07:58:45 +01:00
0cd4403cc2 a 2025-02-14 07:58:32 +01:00
4cae4e9e28 a 2025-02-13 18:50:22 +01:00
5c211013b5 a 2025-02-05 13:31:32 +01:00
cdba13032a technically right but ugly 2025-02-05 13:10:44 +01:00
c0cf1f4177 6 technically incorrect 2025-02-05 12:20:00 +01:00
9844efeaad a 2025-02-04 20:42:51 +01:00
20c1401458 a 2024-12-30 20:26:12 +01:00
774c355b45 asd 2024-11-24 18:12:39 +01:00
3954d3b1bf a 2024-10-29 14:11:37 +01:00
24cffc3c6c ue4 2024-10-29 14:11:18 +01:00
6eca31ddc7 a 2024-10-13 22:46:02 +02:00
b8fc2b7ccb a 2024-10-13 21:47:50 +02:00
084b66fe0e a 2024-10-13 21:47:23 +02:00
5d1ec4f974 a 2024-10-04 18:45:27 +02:00
1c3f79605b p2 2024-09-30 19:27:17 +02:00
9a1615c1ea a 2024-09-30 18:17:21 +02:00
483d40da91 yeet 2024-02-11 21:25:40 +01:00
e69dd43fea yeet 2024-02-11 20:33:19 +01:00
20099ae740 aaaaa 2024-02-11 17:49:29 +01:00
489ca42d32 yeet 2024-02-10 20:51:14 +01:00
243bed60eb Merge remote-tracking branch 'origin/master' 2024-02-10 16:21:02 +01:00
844800b963 yeet 2024-02-10 16:20:40 +01:00
2198 changed files with 291597 additions and 1136 deletions

View File

@@ -3,7 +3,7 @@
<properties maven-id="org.openjfx:javafx-base:20-ea+2" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/openjfx/javafx-base/20-ea+2/javafx-base-20-ea+2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/openjfx/javafx-base/20-ea+2/javafx-base-20-ea+2-linux.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/openjfx/javafx-base/20-ea+2/javafx-base-20-ea+2-win-x86-monocle.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />

2
.idea/vcs.xml generated
View File

@@ -2,5 +2,7 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/WS24_25/SWTD/BuchRedesign" vcs="Git" />
<mapping directory="$PROJECT_DIR$/WS24_25/SWTD/buchv1" vcs="Git" />
</component>
</project>

View File

@@ -6,4 +6,4 @@ set(CMAKE_CXX_STANDARD 14)
include_directories(WS23_24/Anwendungsentwicklung/src/P11)
add_executable(FH
WS23_24/Anwendungsentwicklung/src/P11/date.c)
WS23_24/Anwendungsentwicklung/src/P11/test.c)

1
FH.iml
View File

@@ -5,6 +5,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/WS22_23/BP" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/WS22_23/EidP" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/WS24_25/SWTD/BuchRedesign/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/CMakeFiles" />
<excludeFolder url="file://$MODULE_DIR$/CMakeFiles" />
<excludeFolder url="file://$MODULE_DIR$/CMakeFiles" />

8
WS23_24/Anwendungsentwicklung/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -0,0 +1 @@
FH

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<module classpath="CMake" type="CPP_MODULE" version="4" />

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$/../..">
<contentRoot DIR="$PROJECT_DIR$" />
</component>
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Anwendungsentwicklung.iml" filepath="$PROJECT_DIR$/.idea/Anwendungsentwicklung.iml" />
</modules>
</component>
</project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View File

@@ -11,5 +11,6 @@
<orderEntry type="library" name="openjfx.javafx.graphics" level="project" />
<orderEntry type="library" name="openjfx.javafx.controls" level="project" />
<orderEntry type="library" name="scala-sdk-2.13.12" level="application" />
<orderEntry type="library" name="scala-sdk-2.13.12" level="application" />
</component>
</module>

View File

@@ -2,13 +2,16 @@ package Klausur_ueb
object Lambda {
def main(args: Array[String]): Unit = {
val a = Array(1, 2, 3, 4, 5)
val summe = a.reduce((x: Int, y: Int) => x + y)
val a = Array(1.0, 2.0, 3.0, 4.0, 5.0)
val summe = a.reduce((x: Double, y: Double) => x + y)
val summeKuerzer = a.reduce((x, y) => x + y)
val summeNochKuerzer = a.reduce(_ * _)
val prodNochKuerzer = a.reduce(_ * _)
val qNochKuerzer = a.reduce(_ / _)
val summeGanzKurz = a.sum //vordefiniert
println(summeGanzKurz)
println(summeNochKuerzer)
println(prodNochKuerzer)
println(qNochKuerzer)
println(1.0/120.0)
}
}

View File

@@ -1,10 +1,8 @@
package Klausur_ueb;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.LongStream;
@@ -15,10 +13,11 @@ public class StreamsTraining {
public static void main(String[] args) {
//startFib();
//directFib();
directFib2();
//lorem();
//System.out.println(fak(25));
//System.out.println(fak(15));
lorem2();
//lorem2();
}
@@ -40,6 +39,24 @@ public class StreamsTraining {
.map(s->s[0])//only take s[0]
.forEach(System.out::println);
}
static void directFib2(){
IntStream.rangeClosed(0, 10)
.mapToObj(StreamsTraining::fibonacciiii)
.forEach(System.out::println);
}
public static int fibonacciiii(int n) {
if (n <= 1)
return n;
int prev = 0;
int curr = 1;
for (int i = 2; i <= n; i++) {
int next = prev + curr;
prev = curr;
curr = next;
}
return curr;
}
static void lorem(){
String lorem = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";

View File

@@ -0,0 +1,12 @@
package P10
object Curry {
def main(args: Array[String]): Unit = {
val curriedSum: Double => Double => Double => Double => Double = a => b => c => d => a+b+c+d
def currieSum2(a:Int)(b:Int): Int => Int => Int = (x:Int)=>(y:Int) => a+b+x+y
val curFunc = curriedSum(1)(2)
val curFunc2 = currieSum2(1)(2)
println(curFunc(3)(4))
println(curFunc2(3)(4))
}
}

View File

@@ -4,19 +4,72 @@ import scala.annotation.tailrec
object FrenchDude {
def main(args: Array[String]): Unit = {
startPascal(5)
println(" ")
startPascal2(5)
println(" ")
fib(5)
}
def pascalTriangle(c: Int, r: Int): Int = {
def startPascal(n:Int):Unit={
pascal(Array(1),n)
}
def startPascal2(n:Int):Unit={
pascal2(Array(1),n)
}
//Endrekursiv
@tailrec
def loop(c0: Int, r0: Int, pred: Array[Int], cur: Array[Int]): Int = {
cur(c0) = (if (c0 > 0) pred(c0 - 1) else 0) + (if (c0 < r0) pred(c0) else 0)
if ((c0 == c) && (r0 == r)) cur(c0)
else if (c0 < r0) loop(c0 + 1, r0, pred, cur)
else loop(0, r0 + 1, cur, new Array(_length = r0 + 2))
def pascal (arr:Array[Int],n:Int): Unit = {
arr.foreach(v => print(v+" "))
var newArr = Array[Int]()
newArr = newArr :+ 1
for (i <- arr.indices){
if (i<arr.length-1)
newArr = newArr:+ arr(i)+arr(i+1)
}
newArr = newArr :+ 1
println()
if(newArr.length <= n+1)
pascal(newArr,n)
}
if ((c == 0) && (r == 0)) 1
else loop(0, 1, Array(1), Array(0, 0))
//Rekursiv, aber nicht Endrekursiv
def pascal2 (arr:Array[Int],n:Int): Unit = {
arr.foreach(v => print(v+" "))
var newArr = Array[Int]()
newArr = newArr :+ 1
for (i <- arr.indices){
if (i<arr.length-1)
newArr = newArr:+ arr(i)+arr(i+1)
}
newArr = newArr :+ 1
println()
if(newArr.length <= n+1)
pascal2(newArr,n)
println()
}
def fib(n: Int): Unit = {
def fibIn(x: Int, previous: Array[Int], current: Array[Int]): Unit = {
def topOffset(off: Int): Int = {
val newX = x + off
if (newX >= 0 && newX < previous.length)
previous(newX)
else
0
}
current(x) = topOffset(-1) + topOffset(0)
print(current(x))
print(" ")
if (x < current.length - 1)
fibIn(x + 1, previous, current)
else if (current.length < n) {
println()
fibIn(0, current, new Array[Int](current.length+1))
}
}
println(1)
fibIn(0, Array(1), new Array[Int](2))
}
}

View File

@@ -0,0 +1,88 @@
//
// Created by jordi on 1/8/24.
//
#include <stdio.h>
void strcpy(char *duplikat, const char *original) {
while ((*duplikat++ = *original++));
}
void strcpy2(char *duplikat, const char *original) {
int i = 0;
while ((duplikat[i] = original[i]) != '\0') {
i++;
}
}
void aufgabe3(){
printf("Aufgabe 3\n");
char original[] = "Hallo Welt";
char duplikat[20];
strcpy(duplikat, original);
printf("Original: %s\n", original);
printf("Duplikat: %s\n", duplikat);
char duplikat2[20];
strcpy2(duplikat2, original);
printf("Original: %s\n", original);
printf("Duplikat: %s\n", duplikat2);
}
void tauschen(int* int1, int* int2){
int tmp = *int2;
*int2 = *int1;
*int1 = tmp;
}
void aufgabe4(){
int int1 = 1;
int int2 = 2;
printf("Int1 is %d\n",int1);
printf("Int2 is %d\n",int2);
tauschen(&int1,&int2);
printf("Nach dem Vertauschen:\n");
printf("Int1 is %d\n",int1);
printf("Int2 is %d\n",int2);
}
#define ARRAY_SIZE 5
void initializeArray(int arr[]) {
printf("Geben Sie %d Ganzzahlen für das Array ein:\n", ARRAY_SIZE);
for (int i = 0; i < ARRAY_SIZE; i++) {
scanf("%d", &arr[i]);
}
}
void printArray(int arr[]) {
printf("Das Array lautet: ");
int *ptr = arr;
for (int i = 0; i < ARRAY_SIZE; i++) {
printf("%d ", *(ptr + i));
}
printf("\n");
}
int sumArray(const int arr[]) {
int sum = 0;
for (int i = 0; i < ARRAY_SIZE; i++) {
sum += *(arr + i);
}
return sum;
}
void aufgabe5() {
int arr[ARRAY_SIZE];
initializeArray(arr);
printArray(arr);
int sum = sumArray(arr);
printf("Die Summe der Elemente im Array beträgt: %d\n", sum);
}
int main() {
aufgabe3();
aufgabe4();
aufgabe5();
}

View File

@@ -1,9 +0,0 @@
//
// Created by jordi on 1/8/24.
//
#include <stdio.h>
int main()
{
printf("hallo");
}

View File

@@ -1,6 +1,7 @@
package P6;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -14,6 +15,7 @@ public class Praktikum {
var time = java.time.LocalDateTime.now();
Path p = Paths.get(home, "java-text.tmp");
try {
if (Files.exists(p))
Files.delete(p);

View File

@@ -1,9 +1,9 @@
package P7;
public class Gabel {
public class Fork {
public boolean takable =true;
int id;
public Gabel(int pID){
public Fork(int pID){
id=pID;
}
public synchronized boolean take(String name) {
@@ -17,5 +17,4 @@ public class Gabel {
System.out.println(name+" hat Gabel "+id+" zuruckgelegt");
takable = true;
}
}

View File

@@ -2,8 +2,8 @@ package P7;
public class Philosoph extends Thread {
String name;
Gabel left,right;
public Philosoph(String pname,Gabel pleft, Gabel pright){
Fork left,right;
public Philosoph(String pname, Fork pleft, Fork pright){
name=pname;
left=pleft;
right=pright;
@@ -21,12 +21,14 @@ public class Philosoph extends Thread {
if(right.take(name)){
if(left.take(name)){
System.out.println(name+" " +"Yeeting");
right.place(name);
left.place(name);
}else{
right.place(name);
System.out.println("kein links");
System.out.println(name+" hat kein links");
}
}else {
System.out.println("kein rechts");
System.out.println(name+" hat kein rechts");
}
}
}

View File

@@ -7,14 +7,14 @@ public class Philosophen {
//int n =Integer.parseInt(args[0]);
int n = 5;
var pList = new ArrayList<Thread>();
var gList= new ArrayList<Gabel>();
var gList= new ArrayList<Fork>();
for(int it =0;it<n;it++){
Gabel g=new Gabel(it);
Fork g=new Fork(it);
gList.add(g);
}
for(int i=0;i<n;i++){
Gabel left = gList.get(i);
Gabel right;
Fork left = gList.get(i);
Fork right;
if (i==0){
right = gList.get(gList.size()-1);
}else {
@@ -24,7 +24,5 @@ public class Philosophen {
pList.add(t);
t.start();
}
}
}

View File

@@ -0,0 +1,45 @@
package P9
import scala.annotation.tailrec
object Counter {
def main(args: Array[String]) {
val arr = Array('a', 'b', 'a', 'a', 'c', 'c', 'c', 'b', 'b', 'a')
val arr2 = Array(1,1,1,3,3,2,2,1,1,4)
startCount(arr2)
println("Count 2: ")
startCount2(arr)
}
def startCount(arr: Array[?]): Unit = {
val dsArr = arr.distinct
val list: List[Int] = List()
count(arr, dsArr,0)
}
def startCount2(arr: Array[?]): Unit = {
val dsArr = arr.distinct
val list: List[Int] = List()
count2(arr, dsArr,0)
}
//Endrekursiv
@tailrec
def count(searchArr: Array[?], containArr: Array[?], index:Int): Unit = {
if (index >= containArr.length)
println("end")
else {
println(containArr(index).toString + ": " + searchArr.count(_==containArr(index)))
count(searchArr, containArr, index+1)
}
}
//Rekursiv, aber nicht Endrekursiv
def count2(searchArr: Array[?], containArr: Array[?], index:Int): Unit = {
if (index >= containArr.length)
println("end")
else {
count2(searchArr, containArr, index+1)
println(containArr(index).toString + ": " + searchArr.count(_==containArr(index)))
}
}
}

View File

@@ -1,10 +0,0 @@
package P9
object Numbers {
def main(args: Array[String]) {
println()
}
}

View File

@@ -1,12 +0,0 @@
object Palindrom {
def main(args: Array[String]) {
println(startCheck("ABCCBA"))
}
def startCheck(word: String): Boolean = {
check(0, word)
}
def check(i: Int, word: String): Boolean = {
if((word.length/2)<=i) true else if (word.charAt(i)==word.charAt(word.length-i-1)&&check(i+1,word)) true else false
}
}

View File

@@ -0,0 +1,28 @@
package P9
import scala.annotation.tailrec
object Palindrome {
def main(args: Array[String]): Unit = {
val word = "ABCDCBA"
println(startCheck(word))
println(startCheck2(word))
}
private def startCheck(word: String): Boolean = {
check(0, word)
}
private def startCheck2(word: String): Boolean = {
check2(0, word)
}
@tailrec
private def check(i: Int, word: String): Boolean = {
((word.length / 2) <= i) || (word.charAt(i) == word.charAt(word.length - i - 1) && check(i + 1, word)) //endrekursiv i guess
}
private def check2(i: Int, word: String): Boolean = {
((word.length / 2) <= i) || check2(i + 1, word) && (word.charAt(i) == word.charAt(word.length - i - 1)) //rekursiv, aber nicht endrekursiv
}
}

View File

@@ -0,0 +1,80 @@
package PhilosophenPak;
import java.util.ArrayList;
public class PhilosophenAIO {
public static void main(String[] args) {
//int n =Integer.parseInt(args[0]);
int n = 5;
var pList = new ArrayList<Thread>();
var gList= new ArrayList<Gabel>();
for(int it =0;it<n;it++){
Gabel g=new Gabel(it);
gList.add(g);
}
for(int i=0;i<n;i++){
Gabel left = gList.get(i);
Gabel right;
if (i==0){
right = gList.get(gList.size()-1);
}else {
right = gList.get(i-1);
}
Thread t = new Philosoph("Philosoph "+i,left, right);
pList.add(t);
t.start();
}
}
}
class Philosoph extends Thread {
String name;
Gabel left,right;
public Philosoph(String pname,Gabel pleft, Gabel pright){
name=pname;
left=pleft;
right=pright;
}
@Override
public void run() {
while (true){
try {
Thread.sleep(500);
}catch (Exception e){
e.printStackTrace();
}
if(right.take(name)){
if(left.take(name)){
System.out.println(name+" " +"Yeeting");
right.place(name);
left.place(name);
}else{
right.place(name);
System.out.println(name+" hat kein links");
}
}else {
System.out.println(name+" hat kein rechts");
}
}
}
}
class Gabel {
public boolean takable =true;
int id;
public Gabel(int pID){
id=pID;
}
public synchronized boolean take(String name) {
if(!takable)
return false;
System.out.println(name+" hat Gabel "+id+" genommen");
takable=false;
return true;
}
public synchronized void place(String name){
System.out.println(name+" hat Gabel "+id+" zuruckgelegt");
takable = true;
}
}

8
WS24_25/PyCharm/pythonProject/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.12 (pythonProject)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13" project-jdk-type="Python SDK" />
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/pythonProject.iml" filepath="$PROJECT_DIR$/.idea/pythonProject.iml" />
</modules>
</component>
</project>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.venv" />
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.13" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
</component>
</project>

View File

@@ -0,0 +1,17 @@
from PIL import Image
# Open the image
image = Image.open('alles_mit_flag.bmp')
# Split the image into Red, Green, and Blue channels
red, green, blue = image.split()
# Save each channel as a separate grayscale image
red.save('red_channel.bmp')
green.save('green_channel.bmp')
blue.save('blue_channel.bmp')
# Optionally, show the images
red.show()
green.show()
blue.show()

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 KiB

View File

@@ -0,0 +1,46 @@
import requests
from fake_useragent import UserAgent
# URL to brute force
url = "https://ctfd.labs.inf.fh-dortmund.de/ctfd-challenge-4"
# Create a UserAgent instance
ua = UserAgent()
# Default HTML content
default_response = """<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>User Agent Info</title>
<link rel="stylesheet" href="/ctfd-challenge-4/static/style.css">
</head>
<body>
<div class="container">
<h1>IBM Workstation Server</h1>
<p>Diese Seite bedient ausschließlich von IBM eingerichtete Geräte</p>
</div>
</body>
</html>"""
# Function to brute force headers
def brute_force_user_agent():
for _ in range(500000): # Adjust the range for the number of User-Agents you want to try
user_agent = ua.random # Generate a random User-Agent
headers = {
"User-Agent": user_agent
}
try:
response = requests.get(url, headers=headers)
if response.text.strip() != default_response.strip():
print(f"User-Agent '{user_agent}' gives a different response:")
print(response.text)
return
# else:
# print(f"Nope: '{user_agent}'")
except requests.exceptions.RequestException as e:
print(f"Error with User-Agent '{user_agent}': {e}")
if __name__ == "__main__":
brute_force_user_agent()

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 KiB

View File

@@ -0,0 +1,51 @@
# def fac(x,y=2):
# return x**y
# list = [1,2,3]
# list2 =[]
# for i in range(len(list)):
# list[i] = fac(list[i])
# print (list)
class Lecture:
def __init__(self, title):
"""
Initializes a new Lecture instance with a title and an empty list of students.
:param title: Title of the lecture
"""
self.title = title
self.students = []
def add_student(self, student_name):
"""
Adds a student to the lecture.
:param student_name: Name of the student to be added
"""
if student_name not in self.students:
self.students.append(student_name)
print(f"{student_name} has been added to the lecture '{self.title}'.")
else:
print(f"{student_name} is already enrolled in the lecture '{self.title}'.")
def number_of_students(self):
"""
Returns the number of students enrolled in the lecture.
:return: The count of students
"""
return len(self.students)
# Example usage
# Create a new lecture
python_lecture = Lecture("Introduction to Python")
# Add students
python_lecture.add_student("Alice")
python_lecture.add_student("Bob")
python_lecture.add_student("Alice") # Attempt to add Alice again
# Get the number of students
print(f"Number of students enrolled in '{python_lecture.title}': {python_lecture.number_of_students()}")

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,70 @@
import pandas as pd
# Load the dataset: Order;Lot Area;Street;Neighborhood;Bldg Type;House Style;Overall Qual;Overall Cond;Year Built;Year Remod/Add;1st Flr over Lot Area;1st Flr SF;Mo Sold;Yr Sold;Sale Type;Sale Condition;SalePrice
data = pd.read_csv("AmesHousing.csv", sep=';')
# View dataset structure
print(data.head())
print(data.info())
# Compute "years since built"
data['Years Since Built'] = data['Yr Sold'] - data['Year Built']
# Compute "years since remod/add"
data['Years Since Remod/Add'] = data['Yr Sold'] - data['Year Remod/Add']
# View the updated dataset
print(data[['Years Since Built', 'Years Since Remod/Add']].head())
# Categorize SalePrice into "cheap" and "expensive"
data['Price Category'] = data['SalePrice'].apply(lambda x: 'cheap' if x <= 160000 else 'expensive')
# View the updated dataset
print(data[['SalePrice', 'Price Category']].head())
# Define a threshold for low-frequency values
threshold = 5
# Iterate through each column
for column in data.columns:
# Only process categorical columns (non-numeric, or treat numeric as categorical if needed)
if data[column].dtype == 'object' or data[column].nunique() < 20: # Customize this condition for your use case
# Count frequency of each value
frequencies = data[column].value_counts()
# Identify categories with few occurrences
low_frequency_values = frequencies[frequencies < threshold].index
# Replace infrequent values with "Other"
data[column] = data[column].apply(lambda x: 'Other' if x in low_frequency_values else x)
# View the dataframe after reclassification
print(data.head())
# Threshold for imbalance percentage (e.g., any class with >99% of the data)
imbalance_threshold = 0.99
# Identify columns to drop
columns_to_drop = []
# Loop through each column in the DataFrame
for column in data.columns:
# Only analyze categorical variables
if data[column].dtype == 'object' or data[column].nunique() < 20:
# Compute class distribution
class_distribution = data[column].value_counts(normalize=True)
# Check if any single class exceeds the imbalance threshold
if class_distribution.max() > imbalance_threshold:
print(f"Extreme imbalance found in '{column}' (Dropping column)")
columns_to_drop.append(column)
# You might want to drop other irrelevant variables explicitly
# Add them to columns_to_drop if not needed
# Example: columns_to_drop.append('Unnamed_column')
# Drop the identified columns
data = data.drop(columns=columns_to_drop)
# Output the cleaned dataset
print(f"Columns dropped: {columns_to_drop}")
print(data.head())

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
import json
def csv_to_json(input_file: str, output_file: str):
data = []
# Step 1: Read the CSV file manually
with open(input_file, 'r') as file:
lines = file.readlines()
# Step 2: Parse the first line to get the headers
headers = lines[0].strip().split(';')
# Step 3: Parse the subsequent lines to get the data
for line in lines[1:]:
values = line.strip().split(';')
# Create a dictionary for each row
row_dict = {headers[i]: values[i] for i in range(len(headers))}
data.append(row_dict)
# Step 4: Save the data to a JSON file
with open(output_file, 'w') as json_file:
json.dump(data, json_file, indent=4)
# Usage
input_csv_file = 'AmesHousing.csv'
output_json_file = 'AmesHousing.json'
csv_to_json(input_csv_file, output_json_file)

View File

@@ -0,0 +1,19 @@
import pandas as pd
def summarize_csv(file_path: str):
# Step 1: Load the CSV file using pandas
df = pd.read_csv(file_path, delimiter=';')
# Step 2: Print general information about the data
print("Data Info:")
print(df.info())
# Step 3: Print statistical summary of the numerical columns
print("\nStatistical Summary:")
print(df.describe())
# Usage
input_csv_file = 'AmesHousing.csv'
summarize_csv(input_csv_file)

View File

@@ -0,0 +1,9 @@
import requests
import json
import pandas as pd
api_url = "https://overfast-api.tekrop.fr/heroes"
response = requests.get(api_url)
json_data = response.json()
with open('heroes.json', 'w') as outfile: json.dump(json_data, outfile)
df = pd.read_json(json.dumps(json_data))
csv_data = df.to_csv('csv_data.csv')

View File

@@ -0,0 +1,42 @@
,key,name,portrait,role
0,ana,Ana,https://d15f34w2p8l1cc.cloudfront.net/overwatch/3429c394716364bbef802180e9763d04812757c205e1b4568bc321772096ed86.png,support
1,ashe,Ashe,https://d15f34w2p8l1cc.cloudfront.net/overwatch/8dc2a024c9b7d95c7141b2ef065590dbc8d9018d12ad15f76b01923986702228.png,damage
2,baptiste,Baptiste,https://d15f34w2p8l1cc.cloudfront.net/overwatch/f979896f74ba22db2a92a85ae1260124ab0a26665957a624365e0f96e5ac5b5c.png,support
3,bastion,Bastion,https://d15f34w2p8l1cc.cloudfront.net/overwatch/4d715f722c42215072b5dd0240904aaed7b5285df0b2b082d0a7f1865b5ea992.png,damage
4,brigitte,Brigitte,https://d15f34w2p8l1cc.cloudfront.net/overwatch/48392820c6976ee1cd8dde13e71df85bf15560083ee5c8658fe7c298095d619a.png,support
5,cassidy,Cassidy,https://d15f34w2p8l1cc.cloudfront.net/overwatch/6cfb48b5597b657c2eafb1277dc5eef4a07eae90c265fcd37ed798189619f0a5.png,damage
6,doomfist,Doomfist,https://d15f34w2p8l1cc.cloudfront.net/overwatch/13750471c693c1a360eb19d5ace229c8599a729cd961d72ebee0e157657b7d18.png,tank
7,dva,D.Va,https://d15f34w2p8l1cc.cloudfront.net/overwatch/ca114f72193e4d58a85c087e9409242f1a31e808cf4058678b8cbf767c2a9a0a.png,tank
8,echo,Echo,https://d15f34w2p8l1cc.cloudfront.net/overwatch/f086bf235cc6b7f138609594218a8385c8e5f6405a39eceb0deb9afb429619fe.png,damage
9,genji,Genji,https://d15f34w2p8l1cc.cloudfront.net/overwatch/4edf5ea6d58c449a2aeb619a3fda9fff36a069dfbe4da8bc5d8ec1c758ddb8dc.png,damage
10,hanzo,Hanzo,https://d15f34w2p8l1cc.cloudfront.net/overwatch/aecd8fa677f0093344fab7ccb7c37516c764df3f5ff339a5a845a030a27ba7e0.png,damage
11,illari,Illari,https://d15f34w2p8l1cc.cloudfront.net/overwatch/5ea986038f9d307bd4613d5e6f2c4c8e7f15f30ceeeabbdd7a06637a38f17e1f.png,support
12,junker-queen,Junker Queen,https://d15f34w2p8l1cc.cloudfront.net/overwatch/cef2406b2244b80506f83b8fb9ebaf214f41fa8795cbeef84026cd8018561d04.png,tank
13,junkrat,Junkrat,https://d15f34w2p8l1cc.cloudfront.net/overwatch/037e3df083624e5480f8996821287479a375f62b470572a22773da0eaf9441d0.png,damage
14,juno,Juno,https://d15f34w2p8l1cc.cloudfront.net/overwatch/585b2d60cbd3c271b6ad5ad0922537af0c6836fab6c89cb9979077f7bb0832b5.png,support
15,kiriko,Kiriko,https://d15f34w2p8l1cc.cloudfront.net/overwatch/088aff2153bdfa426984b1d5c912f6af0ab313f0865a81be0edd114e9a2f79f9.png,support
16,lifeweaver,Lifeweaver,https://d15f34w2p8l1cc.cloudfront.net/overwatch/39d4514f1b858bc228035b09d5a74ed41f8eeefc9a0d1873570b216ba04334df.png,support
17,lucio,Lúcio,https://d15f34w2p8l1cc.cloudfront.net/overwatch/e2ff2527610a0fbe0c9956f80925123ef3e66c213003e29d37436de30b90e4e1.png,support
18,mauga,Mauga,https://d15f34w2p8l1cc.cloudfront.net/overwatch/9ee3f5a62893091d575ec0a0d66df878597086374202c6fc7da2d63320a7d02e.png,tank
19,mei,Mei,https://d15f34w2p8l1cc.cloudfront.net/overwatch/1533fcb0ee1d3f9586f84b4067c6f63eca3322c1c661f69bfb41cd9e4f4bcc11.png,damage
20,mercy,Mercy,https://d15f34w2p8l1cc.cloudfront.net/overwatch/2508ddd39a178d5f6ae993ab43eeb3e7961e5a54a9507e6ae347381193f28943.png,support
21,moira,Moira,https://d15f34w2p8l1cc.cloudfront.net/overwatch/000beeb5606e01497897fa9210dd3b1e78e1159ebfd8afdc9e989047d7d3d08f.png,support
22,orisa,Orisa,https://d15f34w2p8l1cc.cloudfront.net/overwatch/71e96294617e81051d120b5d04b491bb1ea40e2933da44d6631aae149aac411d.png,tank
23,pharah,Pharah,https://d15f34w2p8l1cc.cloudfront.net/overwatch/f8261595eca3e43e3b37cadb8161902cc416e38b7e0caa855f4555001156d814.png,damage
24,ramattra,Ramattra,https://d15f34w2p8l1cc.cloudfront.net/overwatch/3e0367155e1940a24da076c6f1f065aacede88dbc323631491aa0cd5a51e0b66.png,tank
25,reaper,Reaper,https://d15f34w2p8l1cc.cloudfront.net/overwatch/2edb9af69d987bb503cd31f7013ae693640e692b321a73d175957b9e64394f40.png,damage
26,reinhardt,Reinhardt,https://d15f34w2p8l1cc.cloudfront.net/overwatch/490d2f79f8547d6e364306af60c8184fb8024b8e55809e4cc501126109981a65.png,tank
27,roadhog,Roadhog,https://d15f34w2p8l1cc.cloudfront.net/overwatch/72e02e747b66b61fcbc02d35d350770b3ec7cbaabd0a7ca17c0d82743d43a7e8.png,tank
28,sigma,Sigma,https://d15f34w2p8l1cc.cloudfront.net/overwatch/cd7a4c0a0df8924afb2c9f6df864ed040f20250440c36ca2eb634acf6609c5e4.png,tank
29,sojourn,Sojourn,https://d15f34w2p8l1cc.cloudfront.net/overwatch/a53bf7ad9d2f33aaf9199a00989f86d4ba1f67c281ba550312c7d96e70fec4ea.png,damage
30,soldier-76,Soldier: 76,https://d15f34w2p8l1cc.cloudfront.net/overwatch/20b4ef00ed05d6dba75df228241ed528df7b6c9556f04c8070bad1e2f89e0ff5.png,damage
31,sombra,Sombra,https://d15f34w2p8l1cc.cloudfront.net/overwatch/bca8532688f01b071806063b9472f1c0f9fc9c7948e6b59e210006e69cec9022.png,damage
32,symmetra,Symmetra,https://d15f34w2p8l1cc.cloudfront.net/overwatch/7f2024c5387c9d76d944a5db021c2774d1e9d7cbf39e9b6a35b364d38ea250ac.png,damage
33,torbjorn,Torbjörn,https://d15f34w2p8l1cc.cloudfront.net/overwatch/1309ab1add1cc19189a2c8bc7b1471f88efa1073e9705d2397fdb37d45707d01.png,damage
34,tracer,Tracer,https://d15f34w2p8l1cc.cloudfront.net/overwatch/a66413200e934da19540afac965cfe8a2de4ada593d9a52d53108bb28e8bbc9c.png,damage
35,venture,Venture,https://d15f34w2p8l1cc.cloudfront.net/overwatch/7e33dd756c8a1abca519af6c3bf26813f2f81d39885373539efcf8442c4bc647.png,damage
36,widowmaker,Widowmaker,https://d15f34w2p8l1cc.cloudfront.net/overwatch/a714f1cb33cc91c6b5b3e89ffe7e325b99e7c89cc8e8feced594f81305147efe.png,damage
37,winston,Winston,https://d15f34w2p8l1cc.cloudfront.net/overwatch/bd9c8e634d89488459dfc1aeb21b602fa5c39aa05601a4167682f3a3fed4e0ee.png,tank
38,wrecking-ball,Wrecking Ball,https://d15f34w2p8l1cc.cloudfront.net/overwatch/5c18e39ce567ee8a84078f775b9f76a2ba891de601c059a3d2b46b61ae4afb42.png,tank
39,zarya,Zarya,https://d15f34w2p8l1cc.cloudfront.net/overwatch/8819ba85823136640d8eba2af6fd7b19d46b9ee8ab192a4e06f396d1e5231f7a.png,tank
40,zenyatta,Zenyatta,https://d15f34w2p8l1cc.cloudfront.net/overwatch/71cabc939c577581f66b952f9c70891db779251e8e70f29de3c7bf494edacfe4.png,support
1 key name portrait role
2 0 ana Ana https://d15f34w2p8l1cc.cloudfront.net/overwatch/3429c394716364bbef802180e9763d04812757c205e1b4568bc321772096ed86.png support
3 1 ashe Ashe https://d15f34w2p8l1cc.cloudfront.net/overwatch/8dc2a024c9b7d95c7141b2ef065590dbc8d9018d12ad15f76b01923986702228.png damage
4 2 baptiste Baptiste https://d15f34w2p8l1cc.cloudfront.net/overwatch/f979896f74ba22db2a92a85ae1260124ab0a26665957a624365e0f96e5ac5b5c.png support
5 3 bastion Bastion https://d15f34w2p8l1cc.cloudfront.net/overwatch/4d715f722c42215072b5dd0240904aaed7b5285df0b2b082d0a7f1865b5ea992.png damage
6 4 brigitte Brigitte https://d15f34w2p8l1cc.cloudfront.net/overwatch/48392820c6976ee1cd8dde13e71df85bf15560083ee5c8658fe7c298095d619a.png support
7 5 cassidy Cassidy https://d15f34w2p8l1cc.cloudfront.net/overwatch/6cfb48b5597b657c2eafb1277dc5eef4a07eae90c265fcd37ed798189619f0a5.png damage
8 6 doomfist Doomfist https://d15f34w2p8l1cc.cloudfront.net/overwatch/13750471c693c1a360eb19d5ace229c8599a729cd961d72ebee0e157657b7d18.png tank
9 7 dva D.Va https://d15f34w2p8l1cc.cloudfront.net/overwatch/ca114f72193e4d58a85c087e9409242f1a31e808cf4058678b8cbf767c2a9a0a.png tank
10 8 echo Echo https://d15f34w2p8l1cc.cloudfront.net/overwatch/f086bf235cc6b7f138609594218a8385c8e5f6405a39eceb0deb9afb429619fe.png damage
11 9 genji Genji https://d15f34w2p8l1cc.cloudfront.net/overwatch/4edf5ea6d58c449a2aeb619a3fda9fff36a069dfbe4da8bc5d8ec1c758ddb8dc.png damage
12 10 hanzo Hanzo https://d15f34w2p8l1cc.cloudfront.net/overwatch/aecd8fa677f0093344fab7ccb7c37516c764df3f5ff339a5a845a030a27ba7e0.png damage
13 11 illari Illari https://d15f34w2p8l1cc.cloudfront.net/overwatch/5ea986038f9d307bd4613d5e6f2c4c8e7f15f30ceeeabbdd7a06637a38f17e1f.png support
14 12 junker-queen Junker Queen https://d15f34w2p8l1cc.cloudfront.net/overwatch/cef2406b2244b80506f83b8fb9ebaf214f41fa8795cbeef84026cd8018561d04.png tank
15 13 junkrat Junkrat https://d15f34w2p8l1cc.cloudfront.net/overwatch/037e3df083624e5480f8996821287479a375f62b470572a22773da0eaf9441d0.png damage
16 14 juno Juno https://d15f34w2p8l1cc.cloudfront.net/overwatch/585b2d60cbd3c271b6ad5ad0922537af0c6836fab6c89cb9979077f7bb0832b5.png support
17 15 kiriko Kiriko https://d15f34w2p8l1cc.cloudfront.net/overwatch/088aff2153bdfa426984b1d5c912f6af0ab313f0865a81be0edd114e9a2f79f9.png support
18 16 lifeweaver Lifeweaver https://d15f34w2p8l1cc.cloudfront.net/overwatch/39d4514f1b858bc228035b09d5a74ed41f8eeefc9a0d1873570b216ba04334df.png support
19 17 lucio Lúcio https://d15f34w2p8l1cc.cloudfront.net/overwatch/e2ff2527610a0fbe0c9956f80925123ef3e66c213003e29d37436de30b90e4e1.png support
20 18 mauga Mauga https://d15f34w2p8l1cc.cloudfront.net/overwatch/9ee3f5a62893091d575ec0a0d66df878597086374202c6fc7da2d63320a7d02e.png tank
21 19 mei Mei https://d15f34w2p8l1cc.cloudfront.net/overwatch/1533fcb0ee1d3f9586f84b4067c6f63eca3322c1c661f69bfb41cd9e4f4bcc11.png damage
22 20 mercy Mercy https://d15f34w2p8l1cc.cloudfront.net/overwatch/2508ddd39a178d5f6ae993ab43eeb3e7961e5a54a9507e6ae347381193f28943.png support
23 21 moira Moira https://d15f34w2p8l1cc.cloudfront.net/overwatch/000beeb5606e01497897fa9210dd3b1e78e1159ebfd8afdc9e989047d7d3d08f.png support
24 22 orisa Orisa https://d15f34w2p8l1cc.cloudfront.net/overwatch/71e96294617e81051d120b5d04b491bb1ea40e2933da44d6631aae149aac411d.png tank
25 23 pharah Pharah https://d15f34w2p8l1cc.cloudfront.net/overwatch/f8261595eca3e43e3b37cadb8161902cc416e38b7e0caa855f4555001156d814.png damage
26 24 ramattra Ramattra https://d15f34w2p8l1cc.cloudfront.net/overwatch/3e0367155e1940a24da076c6f1f065aacede88dbc323631491aa0cd5a51e0b66.png tank
27 25 reaper Reaper https://d15f34w2p8l1cc.cloudfront.net/overwatch/2edb9af69d987bb503cd31f7013ae693640e692b321a73d175957b9e64394f40.png damage
28 26 reinhardt Reinhardt https://d15f34w2p8l1cc.cloudfront.net/overwatch/490d2f79f8547d6e364306af60c8184fb8024b8e55809e4cc501126109981a65.png tank
29 27 roadhog Roadhog https://d15f34w2p8l1cc.cloudfront.net/overwatch/72e02e747b66b61fcbc02d35d350770b3ec7cbaabd0a7ca17c0d82743d43a7e8.png tank
30 28 sigma Sigma https://d15f34w2p8l1cc.cloudfront.net/overwatch/cd7a4c0a0df8924afb2c9f6df864ed040f20250440c36ca2eb634acf6609c5e4.png tank
31 29 sojourn Sojourn https://d15f34w2p8l1cc.cloudfront.net/overwatch/a53bf7ad9d2f33aaf9199a00989f86d4ba1f67c281ba550312c7d96e70fec4ea.png damage
32 30 soldier-76 Soldier: 76 https://d15f34w2p8l1cc.cloudfront.net/overwatch/20b4ef00ed05d6dba75df228241ed528df7b6c9556f04c8070bad1e2f89e0ff5.png damage
33 31 sombra Sombra https://d15f34w2p8l1cc.cloudfront.net/overwatch/bca8532688f01b071806063b9472f1c0f9fc9c7948e6b59e210006e69cec9022.png damage
34 32 symmetra Symmetra https://d15f34w2p8l1cc.cloudfront.net/overwatch/7f2024c5387c9d76d944a5db021c2774d1e9d7cbf39e9b6a35b364d38ea250ac.png damage
35 33 torbjorn Torbjörn https://d15f34w2p8l1cc.cloudfront.net/overwatch/1309ab1add1cc19189a2c8bc7b1471f88efa1073e9705d2397fdb37d45707d01.png damage
36 34 tracer Tracer https://d15f34w2p8l1cc.cloudfront.net/overwatch/a66413200e934da19540afac965cfe8a2de4ada593d9a52d53108bb28e8bbc9c.png damage
37 35 venture Venture https://d15f34w2p8l1cc.cloudfront.net/overwatch/7e33dd756c8a1abca519af6c3bf26813f2f81d39885373539efcf8442c4bc647.png damage
38 36 widowmaker Widowmaker https://d15f34w2p8l1cc.cloudfront.net/overwatch/a714f1cb33cc91c6b5b3e89ffe7e325b99e7c89cc8e8feced594f81305147efe.png damage
39 37 winston Winston https://d15f34w2p8l1cc.cloudfront.net/overwatch/bd9c8e634d89488459dfc1aeb21b602fa5c39aa05601a4167682f3a3fed4e0ee.png tank
40 38 wrecking-ball Wrecking Ball https://d15f34w2p8l1cc.cloudfront.net/overwatch/5c18e39ce567ee8a84078f775b9f76a2ba891de601c059a3d2b46b61ae4afb42.png tank
41 39 zarya Zarya https://d15f34w2p8l1cc.cloudfront.net/overwatch/8819ba85823136640d8eba2af6fd7b19d46b9ee8ab192a4e06f396d1e5231f7a.png tank
42 40 zenyatta Zenyatta https://d15f34w2p8l1cc.cloudfront.net/overwatch/71cabc939c577581f66b952f9c70891db779251e8e70f29de3c7bf494edacfe4.png support

View File

@@ -0,0 +1,4 @@
import pandas as pd
df = pd.read_csv('labels.csv')
label_counts = df['Label'].value_counts()
print(label_counts)

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,351 @@
Image Name,Label
img_239.jpg,8
img_111.jpg,0
img_9.jpg,0
img_341.jpg,6
img_60.jpg,0
img_268.jpg,8
img_241.jpg,8
img_113.jpg,4
img_247.jpg,9
img_138.jpg,1
img_307.jpg,7
img_34.jpg,2
img_210.jpg,2
img_318.jpg,4
img_178.jpg,4
img_261.jpg,6
img_271.jpg,6
img_167.jpg,7
img_107.jpg,0
img_170.jpg,0
img_193.jpg,4
img_164.jpg,5
img_38.jpg,5
img_57.jpg,1
img_154.jpg,6
img_297.jpg,3
img_46.jpg,7
img_220.jpg,4
img_69.jpg,0
img_267.jpg,6
img_293.jpg,7
img_184.jpg,2
img_45.jpg,8
img_249.jpg,3
img_180.jpg,2
img_198.jpg,7
img_330.jpg,3
img_206.jpg,0
img_92.jpg,0
img_75.jpg,2
img_73.jpg,8
img_182.jpg,8
img_328.jpg,1
img_202.jpg,9
img_291.jpg,5
img_87.jpg,4
img_269.jpg,3
img_326.jpg,4
img_89.jpg,6
img_302.jpg,9
img_47.jpg,8
img_131.jpg,3
img_155.jpg,5
img_309.jpg,4
img_20.jpg,0
img_49.jpg,6
img_160.jpg,8
img_171.jpg,2
img_132.jpg,5
img_72.jpg,5
img_100.jpg,4
img_48.jpg,2
img_316.jpg,3
img_266.jpg,0
img_41.jpg,7
img_71.jpg,6
img_156.jpg,3
img_151.jpg,4
img_121.jpg,3
img_70.jpg,1
img_147.jpg,7
img_203.jpg,0
img_91.jpg,2
img_254.jpg,3
img_67.jpg,1
img_233.jpg,9
img_336.jpg,9
img_142.jpg,3
img_248.jpg,8
img_124.jpg,8
img_216.jpg,2
img_13.jpg,4
img_343.jpg,1
img_272.jpg,0
img_252.jpg,7
img_54.jpg,3
img_333.jpg,1
img_94.jpg,6
img_191.jpg,6
img_232.jpg,4
img_42.jpg,7
img_110.jpg,8
img_201.jpg,1
img_37.jpg,5
img_144.jpg,5
img_262.jpg,3
img_162.jpg,0
img_277.jpg,1
img_29.jpg,4
img_62.jpg,1
img_234.jpg,1
img_215.jpg,3
img_97.jpg,3
img_259.jpg,4
img_8.jpg,3
img_17.jpg,3
img_349.jpg,2
img_14.jpg,0
img_211.jpg,0
img_317.jpg,8
img_213.jpg,3
img_43.jpg,4
img_96.jpg,4
img_258.jpg,1
img_109.jpg,0
img_189.jpg,6
img_298.jpg,0
img_65.jpg,0
img_313.jpg,9
img_337.jpg,0
img_344.jpg,8
img_7.jpg,0
img_16.jpg,3
img_218.jpg,6
img_240.jpg,6
img_165.jpg,1
img_303.jpg,8
img_177.jpg,7
img_288.jpg,1
img_53.jpg,8
img_315.jpg,0
img_139.jpg,3
img_222.jpg,3
img_296.jpg,6
img_55.jpg,8
img_76.jpg,8
img_314.jpg,0
img_279.jpg,8
img_5.jpg,3
img_85.jpg,9
img_229.jpg,1
img_145.jpg,5
img_322.jpg,1
img_115.jpg,1
img_26.jpg,4
img_33.jpg,4
img_321.jpg,4
img_284.jpg,0
img_150.jpg,8
img_86.jpg,2
img_129.jpg,7
img_11.jpg,5
img_331.jpg,6
img_339.jpg,6
img_244.jpg,8
img_81.jpg,5
img_263.jpg,3
img_56.jpg,2
img_273.jpg,6
img_83.jpg,1
img_30.jpg,7
img_22.jpg,1
img_224.jpg,2
img_169.jpg,3
img_292.jpg,7
img_197.jpg,9
img_122.jpg,7
img_275.jpg,9
img_231.jpg,0
img_157.jpg,7
img_238.jpg,3
img_15.jpg,4
img_207.jpg,8
img_2.jpg,0
img_179.jpg,1
img_310.jpg,5
img_243.jpg,2
img_304.jpg,2
img_278.jpg,5
img_236.jpg,3
img_320.jpg,8
img_58.jpg,2
img_345.jpg,6
img_306.jpg,3
img_63.jpg,7
img_24.jpg,5
img_319.jpg,1
img_117.jpg,1
img_256.jpg,4
img_134.jpg,0
img_312.jpg,5
img_44.jpg,9
img_226.jpg,0
img_350.jpg,2
img_274.jpg,3
img_32.jpg,5
img_126.jpg,3
img_199.jpg,6
img_166.jpg,3
img_342.jpg,3
img_185.jpg,4
img_102.jpg,9
img_84.jpg,0
img_78.jpg,9
img_112.jpg,0
img_80.jpg,3
img_264.jpg,5
img_192.jpg,1
img_103.jpg,2
img_137.jpg,3
img_175.jpg,1
img_108.jpg,5
img_324.jpg,9
img_299.jpg,3
img_90.jpg,7
img_340.jpg,0
img_152.jpg,3
img_208.jpg,4
img_227.jpg,4
img_245.jpg,5
img_6.jpg,7
img_305.jpg,6
img_68.jpg,9
img_161.jpg,3
img_257.jpg,5
img_31.jpg,7
img_190.jpg,0
img_286.jpg,3
img_300.jpg,3
img_225.jpg,2
img_187.jpg,2
img_181.jpg,4
img_348.jpg,5
img_289.jpg,9
img_64.jpg,0
img_188.jpg,1
img_242.jpg,6
img_168.jpg,6
img_159.jpg,7
img_36.jpg,2
img_93.jpg,6
img_133.jpg,4
img_332.jpg,3
img_230.jpg,0
img_77.jpg,9
img_301.jpg,6
img_127.jpg,8
img_214.jpg,6
img_174.jpg,6
img_221.jpg,2
img_246.jpg,5
img_120.jpg,3
img_149.jpg,2
img_276.jpg,5
img_280.jpg,4
img_235.jpg,7
img_219.jpg,3
img_114.jpg,7
img_50.jpg,7
img_265.jpg,1
img_251.jpg,9
img_290.jpg,9
img_295.jpg,9
img_153.jpg,5
img_173.jpg,8
img_205.jpg,9
img_281.jpg,0
img_253.jpg,1
img_204.jpg,9
img_270.jpg,1
img_27.jpg,2
img_123.jpg,2
img_23.jpg,1
img_1.jpg,2
img_99.jpg,7
img_143.jpg,4
img_250.jpg,5
img_237.jpg,2
img_196.jpg,0
img_285.jpg,5
img_223.jpg,1
img_125.jpg,6
img_311.jpg,8
img_228.jpg,6
img_183.jpg,5
img_212.jpg,9
img_21.jpg,9
img_325.jpg,8
img_52.jpg,8
img_323.jpg,1
img_334.jpg,3
img_105.jpg,7
img_116.jpg,7
img_130.jpg,4
img_51.jpg,6
img_4.jpg,0
img_283.jpg,2
img_329.jpg,5
img_59.jpg,2
img_327.jpg,5
img_28.jpg,7
img_39.jpg,1
img_3.jpg,9
img_10.jpg,3
img_194.jpg,9
img_12.jpg,7
img_141.jpg,4
img_128.jpg,7
img_255.jpg,8
img_74.jpg,8
img_176.jpg,3
img_118.jpg,1
img_40.jpg,6
img_186.jpg,9
img_172.jpg,7
img_18.jpg,1
img_294.jpg,9
img_136.jpg,0
img_338.jpg,0
img_19.jpg,9
img_260.jpg,5
img_135.jpg,0
img_98.jpg,9
img_88.jpg,3
img_79.jpg,2
img_61.jpg,4
img_308.jpg,1
img_195.jpg,6
img_119.jpg,3
img_101.jpg,0
img_200.jpg,9
img_82.jpg,4
img_287.jpg,7
img_163.jpg,4
img_347.jpg,6
img_158.jpg,5
img_346.jpg,0
img_35.jpg,6
img_25.jpg,7
img_146.jpg,8
img_148.jpg,4
img_282.jpg,9
img_217.jpg,1
img_106.jpg,3
img_335.jpg,0
img_104.jpg,0
img_95.jpg,1
img_209.jpg,6
img_140.jpg,6
img_66.jpg,0
1 Image Name Label
2 img_239.jpg 8
3 img_111.jpg 0
4 img_9.jpg 0
5 img_341.jpg 6
6 img_60.jpg 0
7 img_268.jpg 8
8 img_241.jpg 8
9 img_113.jpg 4
10 img_247.jpg 9
11 img_138.jpg 1
12 img_307.jpg 7
13 img_34.jpg 2
14 img_210.jpg 2
15 img_318.jpg 4
16 img_178.jpg 4
17 img_261.jpg 6
18 img_271.jpg 6
19 img_167.jpg 7
20 img_107.jpg 0
21 img_170.jpg 0
22 img_193.jpg 4
23 img_164.jpg 5
24 img_38.jpg 5
25 img_57.jpg 1
26 img_154.jpg 6
27 img_297.jpg 3
28 img_46.jpg 7
29 img_220.jpg 4
30 img_69.jpg 0
31 img_267.jpg 6
32 img_293.jpg 7
33 img_184.jpg 2
34 img_45.jpg 8
35 img_249.jpg 3
36 img_180.jpg 2
37 img_198.jpg 7
38 img_330.jpg 3
39 img_206.jpg 0
40 img_92.jpg 0
41 img_75.jpg 2
42 img_73.jpg 8
43 img_182.jpg 8
44 img_328.jpg 1
45 img_202.jpg 9
46 img_291.jpg 5
47 img_87.jpg 4
48 img_269.jpg 3
49 img_326.jpg 4
50 img_89.jpg 6
51 img_302.jpg 9
52 img_47.jpg 8
53 img_131.jpg 3
54 img_155.jpg 5
55 img_309.jpg 4
56 img_20.jpg 0
57 img_49.jpg 6
58 img_160.jpg 8
59 img_171.jpg 2
60 img_132.jpg 5
61 img_72.jpg 5
62 img_100.jpg 4
63 img_48.jpg 2
64 img_316.jpg 3
65 img_266.jpg 0
66 img_41.jpg 7
67 img_71.jpg 6
68 img_156.jpg 3
69 img_151.jpg 4
70 img_121.jpg 3
71 img_70.jpg 1
72 img_147.jpg 7
73 img_203.jpg 0
74 img_91.jpg 2
75 img_254.jpg 3
76 img_67.jpg 1
77 img_233.jpg 9
78 img_336.jpg 9
79 img_142.jpg 3
80 img_248.jpg 8
81 img_124.jpg 8
82 img_216.jpg 2
83 img_13.jpg 4
84 img_343.jpg 1
85 img_272.jpg 0
86 img_252.jpg 7
87 img_54.jpg 3
88 img_333.jpg 1
89 img_94.jpg 6
90 img_191.jpg 6
91 img_232.jpg 4
92 img_42.jpg 7
93 img_110.jpg 8
94 img_201.jpg 1
95 img_37.jpg 5
96 img_144.jpg 5
97 img_262.jpg 3
98 img_162.jpg 0
99 img_277.jpg 1
100 img_29.jpg 4
101 img_62.jpg 1
102 img_234.jpg 1
103 img_215.jpg 3
104 img_97.jpg 3
105 img_259.jpg 4
106 img_8.jpg 3
107 img_17.jpg 3
108 img_349.jpg 2
109 img_14.jpg 0
110 img_211.jpg 0
111 img_317.jpg 8
112 img_213.jpg 3
113 img_43.jpg 4
114 img_96.jpg 4
115 img_258.jpg 1
116 img_109.jpg 0
117 img_189.jpg 6
118 img_298.jpg 0
119 img_65.jpg 0
120 img_313.jpg 9
121 img_337.jpg 0
122 img_344.jpg 8
123 img_7.jpg 0
124 img_16.jpg 3
125 img_218.jpg 6
126 img_240.jpg 6
127 img_165.jpg 1
128 img_303.jpg 8
129 img_177.jpg 7
130 img_288.jpg 1
131 img_53.jpg 8
132 img_315.jpg 0
133 img_139.jpg 3
134 img_222.jpg 3
135 img_296.jpg 6
136 img_55.jpg 8
137 img_76.jpg 8
138 img_314.jpg 0
139 img_279.jpg 8
140 img_5.jpg 3
141 img_85.jpg 9
142 img_229.jpg 1
143 img_145.jpg 5
144 img_322.jpg 1
145 img_115.jpg 1
146 img_26.jpg 4
147 img_33.jpg 4
148 img_321.jpg 4
149 img_284.jpg 0
150 img_150.jpg 8
151 img_86.jpg 2
152 img_129.jpg 7
153 img_11.jpg 5
154 img_331.jpg 6
155 img_339.jpg 6
156 img_244.jpg 8
157 img_81.jpg 5
158 img_263.jpg 3
159 img_56.jpg 2
160 img_273.jpg 6
161 img_83.jpg 1
162 img_30.jpg 7
163 img_22.jpg 1
164 img_224.jpg 2
165 img_169.jpg 3
166 img_292.jpg 7
167 img_197.jpg 9
168 img_122.jpg 7
169 img_275.jpg 9
170 img_231.jpg 0
171 img_157.jpg 7
172 img_238.jpg 3
173 img_15.jpg 4
174 img_207.jpg 8
175 img_2.jpg 0
176 img_179.jpg 1
177 img_310.jpg 5
178 img_243.jpg 2
179 img_304.jpg 2
180 img_278.jpg 5
181 img_236.jpg 3
182 img_320.jpg 8
183 img_58.jpg 2
184 img_345.jpg 6
185 img_306.jpg 3
186 img_63.jpg 7
187 img_24.jpg 5
188 img_319.jpg 1
189 img_117.jpg 1
190 img_256.jpg 4
191 img_134.jpg 0
192 img_312.jpg 5
193 img_44.jpg 9
194 img_226.jpg 0
195 img_350.jpg 2
196 img_274.jpg 3
197 img_32.jpg 5
198 img_126.jpg 3
199 img_199.jpg 6
200 img_166.jpg 3
201 img_342.jpg 3
202 img_185.jpg 4
203 img_102.jpg 9
204 img_84.jpg 0
205 img_78.jpg 9
206 img_112.jpg 0
207 img_80.jpg 3
208 img_264.jpg 5
209 img_192.jpg 1
210 img_103.jpg 2
211 img_137.jpg 3
212 img_175.jpg 1
213 img_108.jpg 5
214 img_324.jpg 9
215 img_299.jpg 3
216 img_90.jpg 7
217 img_340.jpg 0
218 img_152.jpg 3
219 img_208.jpg 4
220 img_227.jpg 4
221 img_245.jpg 5
222 img_6.jpg 7
223 img_305.jpg 6
224 img_68.jpg 9
225 img_161.jpg 3
226 img_257.jpg 5
227 img_31.jpg 7
228 img_190.jpg 0
229 img_286.jpg 3
230 img_300.jpg 3
231 img_225.jpg 2
232 img_187.jpg 2
233 img_181.jpg 4
234 img_348.jpg 5
235 img_289.jpg 9
236 img_64.jpg 0
237 img_188.jpg 1
238 img_242.jpg 6
239 img_168.jpg 6
240 img_159.jpg 7
241 img_36.jpg 2
242 img_93.jpg 6
243 img_133.jpg 4
244 img_332.jpg 3
245 img_230.jpg 0
246 img_77.jpg 9
247 img_301.jpg 6
248 img_127.jpg 8
249 img_214.jpg 6
250 img_174.jpg 6
251 img_221.jpg 2
252 img_246.jpg 5
253 img_120.jpg 3
254 img_149.jpg 2
255 img_276.jpg 5
256 img_280.jpg 4
257 img_235.jpg 7
258 img_219.jpg 3
259 img_114.jpg 7
260 img_50.jpg 7
261 img_265.jpg 1
262 img_251.jpg 9
263 img_290.jpg 9
264 img_295.jpg 9
265 img_153.jpg 5
266 img_173.jpg 8
267 img_205.jpg 9
268 img_281.jpg 0
269 img_253.jpg 1
270 img_204.jpg 9
271 img_270.jpg 1
272 img_27.jpg 2
273 img_123.jpg 2
274 img_23.jpg 1
275 img_1.jpg 2
276 img_99.jpg 7
277 img_143.jpg 4
278 img_250.jpg 5
279 img_237.jpg 2
280 img_196.jpg 0
281 img_285.jpg 5
282 img_223.jpg 1
283 img_125.jpg 6
284 img_311.jpg 8
285 img_228.jpg 6
286 img_183.jpg 5
287 img_212.jpg 9
288 img_21.jpg 9
289 img_325.jpg 8
290 img_52.jpg 8
291 img_323.jpg 1
292 img_334.jpg 3
293 img_105.jpg 7
294 img_116.jpg 7
295 img_130.jpg 4
296 img_51.jpg 6
297 img_4.jpg 0
298 img_283.jpg 2
299 img_329.jpg 5
300 img_59.jpg 2
301 img_327.jpg 5
302 img_28.jpg 7
303 img_39.jpg 1
304 img_3.jpg 9
305 img_10.jpg 3
306 img_194.jpg 9
307 img_12.jpg 7
308 img_141.jpg 4
309 img_128.jpg 7
310 img_255.jpg 8
311 img_74.jpg 8
312 img_176.jpg 3
313 img_118.jpg 1
314 img_40.jpg 6
315 img_186.jpg 9
316 img_172.jpg 7
317 img_18.jpg 1
318 img_294.jpg 9
319 img_136.jpg 0
320 img_338.jpg 0
321 img_19.jpg 9
322 img_260.jpg 5
323 img_135.jpg 0
324 img_98.jpg 9
325 img_88.jpg 3
326 img_79.jpg 2
327 img_61.jpg 4
328 img_308.jpg 1
329 img_195.jpg 6
330 img_119.jpg 3
331 img_101.jpg 0
332 img_200.jpg 9
333 img_82.jpg 4
334 img_287.jpg 7
335 img_163.jpg 4
336 img_347.jpg 6
337 img_158.jpg 5
338 img_346.jpg 0
339 img_35.jpg 6
340 img_25.jpg 7
341 img_146.jpg 8
342 img_148.jpg 4
343 img_282.jpg 9
344 img_217.jpg 1
345 img_106.jpg 3
346 img_335.jpg 0
347 img_104.jpg 0
348 img_95.jpg 1
349 img_209.jpg 6
350 img_140.jpg 6
351 img_66.jpg 0

View File

@@ -0,0 +1,29 @@
import os
import csv
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
# Set the path to your extracted directory
images_path = './numbers'
output_csv = 'labels2.csv'
# Create/open the CSV file for saving labels
with open(output_csv, mode='w', newline='') as file:
writer = csv.writer(file)
writer.writerow(['Image Name', 'Label']) # Header row
for image_name in os.listdir(images_path):
image_path = os.path.join(images_path, image_name)
try:
img = mpimg.imread(image_path)
plt.imshow(img)
plt.axis('off')
plt.show()
label = input(f'Enter the label for {image_name}: ')
writer.writerow([image_name, label])
print(f'Label saved for {image_name}: {label}')
except Exception as e:
print(f"Error processing {image_name}: {e}")

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Some files were not shown because too many files have changed in this diff Show More