summaryrefslogtreecommitdiff
path: root/python/personal
diff options
context:
space:
mode:
authorpants <niklasjo2004@gmail.com>2026-09-21 14:17:03 -0700
committerpants <niklasjo2004@gmail.com>2026-09-21 14:17:03 -0700
commit7b21727285e50b0b050c4ddd70d07542229c5366 (patch)
tree5d369153c5df5b41f3750d25479a68f20169c8ff /python/personal
init
Diffstat (limited to 'python/personal')
-rw-r--r--python/personal/Garry.txt1
-rw-r--r--python/personal/__pycache__/pandas.cpython-311.pycbin0 -> 347 bytes
-rw-r--r--python/personal/me learning python.py122
-rwxr-xr-xpython/personal/pandas.py8
-rw-r--r--python/personal/password.py8
-rw-r--r--python/personal/peepee.py2
-rwxr-xr-xpython/personal/plt.py13
-rw-r--r--python/personal/power_graph.py12
8 files changed, 166 insertions, 0 deletions
diff --git a/python/personal/Garry.txt b/python/personal/Garry.txt
new file mode 100644
index 0000000..6b4d58a
--- /dev/null
+++ b/python/personal/Garry.txt
@@ -0,0 +1 @@
+obamna
diff --git a/python/personal/__pycache__/pandas.cpython-311.pyc b/python/personal/__pycache__/pandas.cpython-311.pyc
new file mode 100644
index 0000000..d9e3dae
--- /dev/null
+++ b/python/personal/__pycache__/pandas.cpython-311.pyc
Binary files differ
diff --git a/python/personal/me learning python.py b/python/personal/me learning python.py
new file mode 100644
index 0000000..6d0b629
--- /dev/null
+++ b/python/personal/me learning python.py
@@ -0,0 +1,122 @@
+# doing some things.
+x = 5.79
+y = int(x)
+print(y)
+
+# printing length of str name with len() function
+name = " Nik is big poop face "
+print(len(name))
+
+# finding and printing index 1 if str name as var z
+z = name[1]
+print(z)
+
+# finding and printing index 2 through 5 of str name as var y
+y = name[2:5]
+print(y)
+
+# replacing all "N" in str name with "P", after stripping blank space from the ends with var.strip()
+name = name.replace("N", "P")
+print(name.strip())
+
+# {} is a placeholder, used for int age here
+age = 36
+txt = "My name is John, and I am {}"
+print(txt.format(age))
+
+# this is true, becuase int age is not empty (its an int, not nothing)
+print(bool(age))
+
+# this is false, because its an empty string (its nothing, not a string)
+print(bool(""))
+
+# defining list body_parts, seeing if str "arm" is present in it, printing "hooray" if it is
+body_parts = ["arm", "leg"]
+if "arm" in body_parts:
+ print("hooray")
+
+### lists, bounded by [], can be modified. tuples, bounded by (), cannot.
+
+# changing index 0 of list body_parts from "arm" to "pooper"
+body_parts[0] = "pooper"
+print(body_parts[0])
+
+# appending "head" to list body_parts, then printing
+body_parts.append("head")
+print(body_parts)
+
+# inserting str "butt" into index 3 of list body_parts
+body_parts.insert(3, "butt")
+print(body_parts)
+
+# printing index -1 (the last one) of body_parts
+print(body_parts[-1])
+
+# defining set computer_parts, and list more_computer_parts
+computer_parts = {"SSD", "CPU", "GPU"}
+more_computer_parts = ["RAM", "HDD", "AIO"]
+
+# updating computer_parts, with more_computer_parts, printing updated list
+computer_parts.update(more_computer_parts)
+print(computer_parts)
+
+# defining dict Truck, and its values
+Truck = {
+ "model" : "Ranger",
+ "year" : 2010,
+ "make" : "Ford",
+ "displacement" : 4.0,
+ "transmission" : 5,
+ "drivetrain" : "4x4"
+}
+
+# printing Trucks "displacement" value
+print(Truck.get("displacement"))
+
+# changing displacement value of dict Truck to 2.8, printing the changed value
+Truck["displacement"] = 2.8
+print(Truck.get("displacement"))
+
+# setting a value, "color" in dict Truck, printing Truck's "color" value, the str "blue"
+Truck["color"] = "blue"
+print(Truck.get("color"))
+
+# using the pop method to remove dict Truck's "transmission" value, printing the resulting dict
+Truck.pop("transmission")
+print(Truck)
+
+# this line was typed on my thinkpad X395
+
+X = 20
+Y = 20
+Z = 30
+
+# logical operator stuff
+if X == Y:
+ print("yes")
+
+if X == Y and Y == Z:
+ print("yes")
+
+# while i < 6, add 1. once it reaches 6, stop adding, and print ("")
+i = 1
+while i < 6:
+ print(i)
+ i += 1
+else:
+
+ print("i is no longer less than 6")
+
+# defining poopfunction
+def poopfunction():
+ fruits = ["apple", "banana", "cherry", "Buthoal"]
+ for x in fruits:
+ if x == "apple":
+ print(x)
+
+# calling poopfunction
+poopfunction()
+
+a = 2
+lambda a : a
+print(a)
diff --git a/python/personal/pandas.py b/python/personal/pandas.py
new file mode 100755
index 0000000..6fbba83
--- /dev/null
+++ b/python/personal/pandas.py
@@ -0,0 +1,8 @@
+import numpy as np
+import scipy.stats as s
+import glob as glob # importing glob as glob
+import pandas as p
+
+
+x = 20
+print(x) \ No newline at end of file
diff --git a/python/personal/password.py b/python/personal/password.py
new file mode 100644
index 0000000..5d45c99
--- /dev/null
+++ b/python/personal/password.py
@@ -0,0 +1,8 @@
+password = open('Garry.txt')
+secret = password.read()
+print("Password?")
+query = input()
+if query == secret:
+ print("correct!")
+else:
+ print("NO NO THE ANSWER IS CUCUMBER") \ No newline at end of file
diff --git a/python/personal/peepee.py b/python/personal/peepee.py
new file mode 100644
index 0000000..4a83f81
--- /dev/null
+++ b/python/personal/peepee.py
@@ -0,0 +1,2 @@
+you = "peepee"
+print("you are a "+ you)
diff --git a/python/personal/plt.py b/python/personal/plt.py
new file mode 100755
index 0000000..c81fd3d
--- /dev/null
+++ b/python/personal/plt.py
@@ -0,0 +1,13 @@
+import numpy as np
+import matplotlib.pyplot as plt
+
+# Let's have our x values just be a count from 0 to 49.
+var1 = np.arange(50)
+print(var1)
+
+# And let's randomly generate some y values!
+var2 = var1 + 10*np.random.randn(50)
+
+plt.scatter(var1,var2)
+
+plt.show()
diff --git a/python/personal/power_graph.py b/python/personal/power_graph.py
new file mode 100644
index 0000000..fda2f64
--- /dev/null
+++ b/python/personal/power_graph.py
@@ -0,0 +1,12 @@
+import matplotlib.pyplot as plt
+import numpy as np
+import io
+
+f = open(".power_log", "r", encoding="utf-8")
+
+data = f.readlines()
+x = np.arange(len(data))
+y = np.loadtxt(".power_log")
+
+plt.plot(x,y)
+plt.show()