myawesomepkg 0.1.3__tar.gz → 0.1.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. myawesomepkg-0.1.5/PKG-INFO +11 -0
  2. myawesomepkg-0.1.5/myawesomepkg/TSAPY1/10-A_Load_stringr.py +77 -0
  3. myawesomepkg-0.1.5/myawesomepkg/TSAPY1/10-B_Forcats.py +70 -0
  4. myawesomepkg-0.1.5/myawesomepkg/TSAPY1/9A_Dplyr.py +85 -0
  5. myawesomepkg-0.1.5/myawesomepkg/TSAPY1/9B_Tidyr.py +71 -0
  6. myawesomepkg-0.1.5/myawesomepkg/TSAPY1/Print_R.py +123 -0
  7. myawesomepkg-0.1.5/myawesomepkg/TSAPY1/R_Graph.py +32 -0
  8. myawesomepkg-0.1.5/myawesomepkg/TSAPY1/Working_Ggplot.py +53 -0
  9. myawesomepkg-0.1.5/myawesomepkg.egg-info/PKG-INFO +11 -0
  10. myawesomepkg-0.1.5/myawesomepkg.egg-info/SOURCES.txt +15 -0
  11. myawesomepkg-0.1.5/setup.py +18 -0
  12. myawesomepkg-0.1.3/PKG-INFO +0 -6
  13. myawesomepkg-0.1.3/myawesomepkg/TSAPY/Practical No 1.py +0 -148
  14. myawesomepkg-0.1.3/myawesomepkg/TSAPY/Practical No 2.py +0 -115
  15. myawesomepkg-0.1.3/myawesomepkg/TSAPY/Practical No 3.py +0 -168
  16. myawesomepkg-0.1.3/myawesomepkg/TSAPY/Practical No 4 A.py +0 -233
  17. myawesomepkg-0.1.3/myawesomepkg/TSAPY/Practical No 4 B.py +0 -137
  18. myawesomepkg-0.1.3/myawesomepkg/TSAPY/Practical No 5.py +0 -52
  19. myawesomepkg-0.1.3/myawesomepkg/TSAPY/Practical No 6.py +0 -29
  20. myawesomepkg-0.1.3/myawesomepkg/TSAPY/Practical No 7.py +0 -67
  21. myawesomepkg-0.1.3/myawesomepkg/TSAPY/Practical No 8.py +0 -108
  22. myawesomepkg-0.1.3/myawesomepkg/d.py +0 -36
  23. myawesomepkg-0.1.3/myawesomepkg.egg-info/PKG-INFO +0 -6
  24. myawesomepkg-0.1.3/myawesomepkg.egg-info/SOURCES.txt +0 -18
  25. myawesomepkg-0.1.3/setup.py +0 -11
  26. {myawesomepkg-0.1.3/myawesomepkg/TSAPY → myawesomepkg-0.1.5/myawesomepkg/TSAPY1}/__init__.py +0 -0
  27. {myawesomepkg-0.1.3 → myawesomepkg-0.1.5}/myawesomepkg/__init__.py +0 -0
  28. {myawesomepkg-0.1.3 → myawesomepkg-0.1.5}/myawesomepkg/core.py +0 -0
  29. {myawesomepkg-0.1.3 → myawesomepkg-0.1.5}/myawesomepkg.egg-info/dependency_links.txt +0 -0
  30. {myawesomepkg-0.1.3 → myawesomepkg-0.1.5}/myawesomepkg.egg-info/top_level.txt +0 -0
  31. {myawesomepkg-0.1.3 → myawesomepkg-0.1.5}/setup.cfg +0 -0
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.1
2
+ Name: myawesomepkg
3
+ Version: 0.1.5
4
+ Summary: A simple greeting library
5
+ Author: Your Name
6
+ Author-email: your.email@example.com
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.6
11
+ Description-Content-Type: text/markdown
@@ -0,0 +1,77 @@
1
+ ✅ Step 1: Load stringr
2
+ r
3
+ Copy
4
+ Edit
5
+ library(stringr)
6
+ 🔹 1. String Basics
7
+ r
8
+ Copy
9
+ Edit
10
+ str <- "Hello Boss"
11
+ str_length(str) # Length of string
12
+ str_to_upper(str) # Uppercase
13
+ str_to_lower(str) # Lowercase
14
+ str_trim(" Hello ") # Trim spaces
15
+ 🔹 2. Combining Strings
16
+ r
17
+ Copy
18
+ Edit
19
+ str1 <- "Hello"
20
+ str2 <- "Boss"
21
+ str_c(str1, str2, sep = " ") # Combine with space
22
+ 🔹 3. Subsetting Strings
23
+ r
24
+ Copy
25
+ Edit
26
+ str_sub("DataScience", 1, 4) # "Data"
27
+ str_sub("DataScience", -7, -1) # "Science"
28
+ 🔹 4. Locales
29
+ r
30
+ Copy
31
+ Edit
32
+ str_to_upper("straße", locale = "de") # German-specific case
33
+ 🔹 5. Basic Matches
34
+ r
35
+ Copy
36
+ Edit
37
+ str_detect("apple", "pp") # TRUE
38
+ str_detect("apple", "z") # FALSE
39
+ 🔹 6. Anchors (^, $)
40
+ r
41
+ Copy
42
+ Edit
43
+ str_detect("Boss is here", "^Boss") # TRUE
44
+ str_detect("Boss is here", "here$") # TRUE
45
+ 🔹 7. Repetition
46
+ r
47
+ Copy
48
+ Edit
49
+ str_view("banana", "na{2}") # Match "n" followed by two "a"s
50
+ str_view("aaa", "a{2,3}") # Match 2 to 3 a's
51
+ 🔹 8. Detect Matches
52
+ r
53
+ Copy
54
+ Edit
55
+ texts <- c("cat", "dog", "cow")
56
+ str_detect(texts, "c") # TRUE FALSE TRUE
57
+ 🔹 9. Extract Matches
58
+ r
59
+ Copy
60
+ Edit
61
+ str_extract("Price: Rs 999", "\\d+") # "999"
62
+ 🔹 10. Grouped Matches
63
+ r
64
+ Copy
65
+ Edit
66
+ str_match("ID: 12345", "ID: (\\d+)") # Group match returns matrix
67
+ 🔹 11. Replacing Matches
68
+ r
69
+ Copy
70
+ Edit
71
+ str_replace("I love cats", "cats", "dogs") # "I love dogs"
72
+ 🔹 12. Splitting
73
+ r
74
+ Copy
75
+ Edit
76
+ str_split("one,two,three", ",")[[1]] # "one" "two" "three"
77
+ Let me know if you want all these examples as a downloadable .R script or a reference
@@ -0,0 +1,70 @@
1
+ ✅ Step 1: Load forcats package
2
+ r
3
+ Copy
4
+ Edit
5
+ library(forcats)
6
+ 🔹 1. Creating Factors
7
+ r
8
+ Copy
9
+ Edit
10
+ grades <- c("B", "A", "C", "A", "B")
11
+ f_grades <- factor(grades)
12
+ f_grades
13
+ With specified order:
14
+
15
+ r
16
+ Copy
17
+ Edit
18
+ f_grades <- factor(grades, levels = c("A", "B", "C"), ordered = TRUE)
19
+ 🔹 2. Modifying Factor Orders
20
+ r
21
+ Copy
22
+ Edit
23
+ # Reorder by frequency
24
+ fct_infreq(f_grades)
25
+
26
+ # Reorder manually
27
+ fct_relevel(f_grades, "C", "B", "A")
28
+ 🔹 3. Modifying Factor Levels (Renaming)
29
+ r
30
+ Copy
31
+ Edit
32
+ fct_recode(f_grades,
33
+ "Excellent" = "A",
34
+ "Good" = "B",
35
+ "Average" = "C")
36
+ 🔹 4. Lump Less Frequent Levels
37
+ r
38
+ Copy
39
+ Edit
40
+ items <- c("apple", "banana", "apple", "cherry", "banana", "fig", "fig", "fig")
41
+ f_items <- factor(items)
42
+
43
+ # Combine less frequent into "Other"
44
+ fct_lump(f_items, n = 2)
45
+ 🔹 5. Drop Unused Levels
46
+ r
47
+ Copy
48
+ Edit
49
+ f <- factor(c("high", "medium", "low"), levels = c("low", "medium", "high", "extreme"))
50
+ f_dropped <- fct_drop(f)
51
+ 🔹 6. Reverse Factor Order
52
+ r
53
+ Copy
54
+ Edit
55
+ fct_rev(f_grades)
56
+ 🔹 7. Count Factors
57
+ r
58
+ Copy
59
+ Edit
60
+ fct_count(f_grades)
61
+ 📌 Summary of Key forcats Functions
62
+
63
+ Function Use Case
64
+ fct_relevel() Change order of levels manually
65
+ fct_infreq() Order by frequency
66
+ fct_recode() Rename factor levels
67
+ fct_lump() Combine low-freq levels
68
+ fct_drop() Drop unused levels
69
+ fct_rev() Reverse order
70
+ fct_count() Count frequencies
@@ -0,0 +1,85 @@
1
+ ✅ Step 1: Load dplyr
2
+ r
3
+ Copy
4
+ Edit
5
+ library(dplyr)
6
+ 🔹 Sample Data
7
+ r
8
+ Copy
9
+ Edit
10
+ employees <- data.frame(
11
+ emp_id = c(1, 2, 3, 4, 5),
12
+ name = c("John", "Emma", "Raj", "Sara", "Mike"),
13
+ dept_id = c(10, 20, 10, 30, 20)
14
+ )
15
+
16
+ departments <- data.frame(
17
+ dept_id = c(10, 20, 30),
18
+ dept_name = c("HR", "Finance", "IT")
19
+ )
20
+ 🔹 1. Filtering Rows
21
+ r
22
+ Copy
23
+ Edit
24
+ # Filter employees from dept 10
25
+ employees %>%
26
+ filter(dept_id == 10)
27
+ 🔹 2. Mutating Joins (left_join)
28
+ r
29
+ Copy
30
+ Edit
31
+ # Add department name to employees
32
+ employees %>%
33
+ left_join(departments, by = "dept_id")
34
+ 🔹 3. Inner Join
35
+ r
36
+ Copy
37
+ Edit
38
+ # Only matching employees with department info
39
+ employees %>%
40
+ inner_join(departments, by = "dept_id")
41
+ 🔹 4. Handling Duplicate Keys
42
+ r
43
+ Copy
44
+ Edit
45
+ # Add a duplicate dept row
46
+ departments2 <- rbind(departments, data.frame(dept_id = 10, dept_name = "HR-Duplicate"))
47
+
48
+ # Join - will create multiple rows for duplicate keys
49
+ employees %>%
50
+ left_join(departments2, by = "dept_id")
51
+ 🔹 5. Defining Key Column (custom join keys)
52
+ r
53
+ Copy
54
+ Edit
55
+ emp <- data.frame(id = c(1, 2), val = c("A", "B"))
56
+ ref <- data.frame(key = c(1, 2), desc = c("X", "Y"))
57
+
58
+ emp %>%
59
+ left_join(ref, by = c("id" = "key"))
60
+ 🔹 6. Filtering Joins
61
+ r
62
+ Copy
63
+ Edit
64
+ # Semi Join: Keep rows in employees that match departments
65
+ employees %>%
66
+ semi_join(departments, by = "dept_id")
67
+
68
+ # Anti Join: Keep rows in employees that don't match departments
69
+ employees %>%
70
+ anti_join(departments, by = "dept_id")
71
+ 🔹 7. Set Operations
72
+ r
73
+ Copy
74
+ Edit
75
+ a <- data.frame(x = c(1, 2, 3))
76
+ b <- data.frame(x = c(2, 3, 4))
77
+
78
+ # Union (unique values)
79
+ union(a, b)
80
+
81
+ # Intersect (common values)
82
+ intersect(a, b)
83
+
84
+ # Set difference (in a but not in b)
85
+ setdiff(a, b)
@@ -0,0 +1,71 @@
1
+ ✅ Step 1: Load tidyr and dplyr
2
+ r
3
+ Copy
4
+ Edit
5
+ library(tidyr)
6
+ library(dplyr)
7
+ 🔹 Sample Data
8
+ r
9
+ Copy
10
+ Edit
11
+ data <- data.frame(
12
+ name = c("Alice", "Bob"),
13
+ math = c(90, 85),
14
+ science = c(95, 80)
15
+ )
16
+ 🔹 1. Gathering → pivot_longer()
17
+ r
18
+ Copy
19
+ Edit
20
+ data_long <- data %>%
21
+ pivot_longer(cols = c(math, science), names_to = "subject", values_to = "score")
22
+
23
+ print(data_long)
24
+ 🔹 2. Spreading → pivot_wider()
25
+ r
26
+ Copy
27
+ Edit
28
+ data_wide <- data_long %>%
29
+ pivot_wider(names_from = subject, values_from = score)
30
+
31
+ print(data_wide)
32
+ 🔹 3. Separate Columns
33
+ r
34
+ Copy
35
+ Edit
36
+ full_name <- data.frame(name = c("Alice_Smith", "Bob_Jones"))
37
+
38
+ # Separate name into first and last
39
+ full_name_sep <- full_name %>%
40
+ separate(name, into = c("first_name", "last_name"), sep = "_")
41
+
42
+ print(full_name_sep)
43
+ 🔹 4. Unite Columns
44
+ r
45
+ Copy
46
+ Edit
47
+ # Combine first_name and last_name
48
+ full_name_united <- full_name_sep %>%
49
+ unite("full_name", first_name, last_name, sep = " ")
50
+
51
+ print(full_name_united)
52
+ 🔹 5. Handling Missing Values
53
+ r
54
+ Copy
55
+ Edit
56
+ missing_data <- data.frame(
57
+ name = c("A", "B", "C"),
58
+ score = c(85, NA, 90)
59
+ )
60
+
61
+ # Remove rows with NA
62
+ missing_data_clean <- missing_data %>%
63
+ drop_na()
64
+
65
+ # Replace NA with value
66
+ missing_data_filled <- missing_data %>%
67
+ replace_na(list(score = 0))
68
+
69
+ print(missing_data_clean)
70
+ print(missing_data_filled)
71
+ Let m
@@ -0,0 +1,123 @@
1
+ 1. Print in R
2
+ r
3
+ Copy
4
+ Edit
5
+ print("Hello Boss!")
6
+ 🔹 2. Comments in R
7
+ r
8
+ Copy
9
+ Edit
10
+ # This is a single-line comment
11
+ 🔹 3. Variables in R
12
+ r
13
+ Copy
14
+ Edit
15
+ x <- 10
16
+ y <- "Data"
17
+ 🔹 4. Concatenate Elements
18
+ r
19
+ Copy
20
+ Edit
21
+ v <- c(1, 2, 3, 4)
22
+ print(v)
23
+ 🔹 5. Multiple Variables
24
+ r
25
+ Copy
26
+ Edit
27
+ a <- 5
28
+ b <- 10
29
+ c <- a + b
30
+ print(c)
31
+ 🔹 6. Variable Names
32
+ r
33
+ Copy
34
+ Edit
35
+ user_name <- "Boss"
36
+ user_age <- 25
37
+ 🔹 7. Data Types
38
+ r
39
+ Copy
40
+ Edit
41
+ num <- 10.5 # Numeric
42
+ str <- "Hello" # Character
43
+ bool <- TRUE # Logical
44
+ vec <- c(1, 2, 3) # Vector
45
+ 🔹 8. Strings
46
+ r
47
+ Copy
48
+ Edit
49
+ name <- "R Programming"
50
+ paste("Welcome to", name)
51
+ 🔹 9. Boolean
52
+ r
53
+ Copy
54
+ Edit
55
+ is_true <- TRUE
56
+ is_false <- FALSE
57
+ 🔹 10. Operators
58
+ r
59
+ Copy
60
+ Edit
61
+ a <- 10
62
+ b <- 3
63
+ a + b # Addition
64
+ a > b # Comparison
65
+ a == b # Equal
66
+ a %% b # Modulus
67
+ 🔹 11. If Else
68
+ r
69
+ Copy
70
+ Edit
71
+ x <- 10
72
+ if (x > 5) {
73
+ print("Greater than 5")
74
+ } else {
75
+ print("5 or less")
76
+ }
77
+ 🔹 12. List
78
+ r
79
+ Copy
80
+ Edit
81
+ my_list <- list(name="Boss", age=25, scores=c(90, 85))
82
+ print(my_list)
83
+ 🔹 13. Matrices
84
+ r
85
+ Copy
86
+ Edit
87
+ matrix_data <- matrix(1:6, nrow=2, ncol=3)
88
+ print(matrix_data)
89
+ 🔹 14. Data Frames
90
+ r
91
+ Copy
92
+ Edit
93
+ df <- data.frame(Name=c("A", "B"), Age=c(20, 25))
94
+ print(df)
95
+ 🔹 15. Functions
96
+ r
97
+ Copy
98
+ Edit
99
+ add_numbers <- function(x, y) {
100
+ return(x + y)
101
+ }
102
+ 🔹 16. Call a Function
103
+ r
104
+ Copy
105
+ Edit
106
+ result <- add_numbers(5, 3)
107
+ print(result)
108
+ 🔹 17. Global Variable
109
+ r
110
+ Copy
111
+ Edit
112
+ x <- 5
113
+ my_func <- function() {
114
+ x <<- 10 # Modify global x
115
+ }
116
+ my_func()
117
+ print(x)
118
+ 🔹 18. Vectors
119
+ r
120
+ Copy
121
+ Edit
122
+ my_vector <- c(1, 2, 3, 4, 5)
123
+ print(my_vector)
@@ -0,0 +1,32 @@
1
+ 1. Line Plot
2
+ r
3
+ Copy
4
+ Edit
5
+ x <- c(1, 2, 3, 4, 5)
6
+ y <- c(2, 4, 6, 8, 10)
7
+
8
+ plot(x, y, type="l", col="blue", main="Line Plot", xlab="X-axis", ylab="Y-axis")
9
+ 🔹 2. Scatter Plot
10
+ r
11
+ Copy
12
+ Edit
13
+ x <- c(1, 2, 3, 4, 5)
14
+ y <- c(5, 3, 6, 2, 7)
15
+
16
+ plot(x, y, main="Scatter Plot", xlab="X", ylab="Y", col="red", pch=19)
17
+ 🔹 3. Pie Chart
18
+ r
19
+ Copy
20
+ Edit
21
+ slices <- c(10, 20, 30, 40)
22
+ labels <- c("A", "B", "C", "D")
23
+
24
+ pie(slices, labels=labels, main="Pie Chart")
25
+ 🔹 4. Bar Chart
26
+ r
27
+ Copy
28
+ Edit
29
+ values <- c(5, 10, 15, 20)
30
+ names <- c("A", "B", "C", "D")
31
+
32
+ barplot(values, names.arg=names, col="green", main="Bar Chart", ylab="Values")
@@ -0,0 +1,53 @@
1
+ ✅ Step 1: Install & Load ggplot2
2
+ r
3
+ Copy
4
+ Edit
5
+ install.packages("ggplot2") # Run once
6
+ library(ggplot2)
7
+ ✅ Step 2: Sample Data
8
+ r
9
+ Copy
10
+ Edit
11
+ data <- data.frame(
12
+ category = rep(c("A", "B", "C"), each=4),
13
+ subcat = rep(c("X", "Y"), times=6),
14
+ value = c(4, 7, 6, 9, 5, 3, 8, 4, 7, 5, 6, 2)
15
+ )
16
+ ✅ Step 3: Basic ggplot
17
+ r
18
+ Copy
19
+ Edit
20
+ ggplot(data, aes(x=subcat, y=value)) +
21
+ geom_bar(stat="identity", fill="steelblue") +
22
+ ggtitle("Basic Bar Chart")
23
+ ✅ Step 4: Facets
24
+ r
25
+ Copy
26
+ Edit
27
+ ggplot(data, aes(x=subcat, y=value)) +
28
+ geom_bar(stat="identity", fill="tomato") +
29
+ facet_wrap(~ category) +
30
+ ggtitle("Faceted by Category")
31
+ ✅ Step 5: Geometric Objects
32
+ r
33
+ Copy
34
+ Edit
35
+ ggplot(data, aes(x=subcat, y=value, fill=category)) +
36
+ geom_bar(stat="identity", position="dodge") + # Bar chart
37
+ geom_point(aes(color=category), size=3, shape=21) + # Add points
38
+ ggtitle("Geometric Objects: Bars + Points")
39
+ ✅ Step 6: Position Adjustment
40
+ r
41
+ Copy
42
+ Edit
43
+ ggplot(data, aes(x=subcat, y=value, fill=category)) +
44
+ geom_bar(stat="identity", position=position_dodge(width=0.7)) +
45
+ ggtitle("Position: Dodge for Side-by-Side Bars")
46
+ ✅ Step 7: Coordinate System (Flip Axis)
47
+ r
48
+ Copy
49
+ Edit
50
+ ggplot(data, aes(x=subcat, y=value, fill=category)) +
51
+ geom_bar(stat="identity") +
52
+ coord_flip() +
53
+ ggtitle("Flipped Coordinates")
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.1
2
+ Name: myawesomepkg
3
+ Version: 0.1.5
4
+ Summary: A simple greeting library
5
+ Author: Your Name
6
+ Author-email: your.email@example.com
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.6
11
+ Description-Content-Type: text/markdown
@@ -0,0 +1,15 @@
1
+ setup.py
2
+ myawesomepkg/__init__.py
3
+ myawesomepkg/core.py
4
+ myawesomepkg.egg-info/PKG-INFO
5
+ myawesomepkg.egg-info/SOURCES.txt
6
+ myawesomepkg.egg-info/dependency_links.txt
7
+ myawesomepkg.egg-info/top_level.txt
8
+ myawesomepkg/TSAPY1/10-A_Load_stringr.py
9
+ myawesomepkg/TSAPY1/10-B_Forcats.py
10
+ myawesomepkg/TSAPY1/9A_Dplyr.py
11
+ myawesomepkg/TSAPY1/9B_Tidyr.py
12
+ myawesomepkg/TSAPY1/Print_R.py
13
+ myawesomepkg/TSAPY1/R_Graph.py
14
+ myawesomepkg/TSAPY1/Working_Ggplot.py
15
+ myawesomepkg/TSAPY1/__init__.py
@@ -0,0 +1,18 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name='myawesomepkg', # Your package name
5
+ version='0.1.5', # Current version
6
+ author='Your Name', # Replace with your actual name
7
+ author_email='your.email@example.com', # Optional: add your email
8
+ description='A simple greeting library',
9
+ long_description_content_type='text/markdown',
10
+ packages=find_packages(),
11
+ install_requires=[], # List dependencies here, e.g., ['numpy']
12
+ python_requires='>=3.6',
13
+ classifiers=[ # Optional but good for PyPI listings
14
+ 'Programming Language :: Python :: 3',
15
+ 'License :: OSI Approved :: MIT License', # Change to your license
16
+ 'Operating System :: OS Independent',
17
+ ],
18
+ )
@@ -1,6 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: myawesomepkg
3
- Version: 0.1.3
4
- Summary: A simple greeting library
5
- Author: Your Name
6
- Requires-Python: >=3.6