├── COURSE_1:Python Basics ├── Week_1 │ ├── Assesment_2.ipynb │ └── Assesment_3.ipynb ├── Week_2 │ ├── assesment_6.ipynb │ └── assessment_5.ipynb └── week_3 │ └── t ├── COURSE_2:Python Functions, Files and Dictionaries ├── Week_1 │ ├── Assesment_1(Course_2).ipynb │ └── assessment_1(Questions) ├── Week_2 │ ├── Assesment_2(Course_2).ipynb │ ├── Assesment_2(Questions) │ └── assessment_3(solutions) ├── Week_3 │ ├── Assesment_4 │ └── Assesment_5 ├── Week_4 │ ├── Assessment_6 │ └── Assessment_7 └── Week_5 │ ├── Assessment_8 │ ├── Course_2 Project │ └── Sentiment_Analysis(Part_2).ipynb ├── COURSE_3:Data Collection and Processing with Python ├── Week_1 │ └── assesment_1(course_3).ipynb ├── Week_2 │ └── assesment_2(course_3).ipynb └── Week_3 │ └── Course_3(project).ipynb ├── COURSE_4:Python Classes and Inheritance ├── README.md ├── Week_1 │ ├── assesment_1(course_4).ipynb │ └── t ├── Week_2 │ └── assesment_2(course_4).ipynb └── Week_3 │ ├── Assesment_3(Course_4).ipynb │ ├── Assesment_4(course_4).ipynb │ ├── asses_3(ques) │ └── asses_4(ques) ├── COURSE_5:Python Project: Pillow, tesseract, and opencv ├── COURSE_5(Assesment_1).ipynb └── Week_3 │ ├── ReadMe.md │ └── Week_3(assignment).ipynb └── README.md /COURSE_1:Python Basics/week_3/t: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /COURSE_2:Python Functions, Files and Dictionaries/Week_1/assessment_1(Questions): -------------------------------------------------------------------------------- 1 | Question:1 2 | The textfile, travel_plans.txt, contains the summer travel plans for someone with some commentary. Find the total number of characters in 3 | the file and save to the variable num. 4 | 5 | Question:2 6 | We have provided a file called emotion_words.txt that contains lines of words that describe emotions. Find the total number of words in 7 | the file and assign this value to the variable num_words. 8 | 9 | Question:3 10 | Assign to the variable num_lines the number of lines in the file school_prompt.txt. 11 | 12 | Question:4 13 | Assign the first 30 characters of school_prompt.txt as a string to the variable beginning_chars. 14 | 15 | 16 | Question:5 17 | Challenge: Using the file school_prompt.txt, assign the third word of every line to a list called three 18 | 19 | Question:6 20 | Challenge: Create a list called emotions that contains the first word of every line in emotion_words.txt. 21 | 22 | Question:7 23 | Assign the first 33 characters from the textfile, travel_plans.txt to the variable first_chars. 24 | 25 | Question:8 26 | Challenge: Using the file school_prompt.txt, if the character ‘p’ is in a word, then add the word to a list called p_words. 27 | 28 | -------------------------------------------------------------------------------- /COURSE_2:Python Functions, Files and Dictionaries/Week_2/Assesment_2(Questions): -------------------------------------------------------------------------------- 1 | Question:1 2 | At the halfway point during the Rio Olympics, the United States had 70 medals, Great Britain had 38 medals, China had 45 medals, Russia had 3 | 30 medals, and Germany had 17 medals. Create a dictionary assigned to the variable medal_count with the country names as the keys and the 4 | number of medals the country had as each key’s value. 5 | 6 | Question:2 7 | Given the dictionary swimmers, add an additional key-value pair to the dictionary with "Phelps" as the key and the integer 23 as the value. 8 | Do not rewrite the entire dictionary. 9 | 10 | Question:3 11 | Add the string “hockey” as a key to the dictionary sports_periods and assign it the value of 3. Do not rewrite the entire dictionary. 12 | 13 | Question:4 14 | The dictionary golds contains information about how many gold medals each country won in the 2016 Olympics. But today, Spain won 2 more 15 | gold medals. Update golds to reflect this information. 16 | 17 | Question:5 18 | Create a list of the countries that are in the dictionary golds, and assign that list to the variable name countries. Do not hard code 19 | this. 20 | 21 | Question:6 22 | Provided is the dictionary, medal_count, which lists countries and their respective medal count at the halfway point in the 2016 Rio 23 | Olympics. Using dictionary mechanics, assign the medal count value for "Belarus" to the variable belarus. Do not hardcode this. 24 | 25 | Question:7 26 | The dictionary total_golds contains the total number of gold medals that countries have won over the course of history. Use dictionary 27 | mechanics to find the number of golds Chile has won, and assign that number to the variable name chile_golds. Do not hard code this! 28 | 29 | Question:8 30 | Provided is a dictionary called US_medals which has the first 70 metals that the United States has won in 2016, and in which category 31 | they have won it in. Using dictionary mechanics, assign the value of the key "Fencing" to a variable fencing_value. Remember, do not 32 | hard code this. 33 | -------------------------------------------------------------------------------- /COURSE_2:Python Functions, Files and Dictionaries/Week_2/assessment_3(solutions): -------------------------------------------------------------------------------- 1 | Question:1 2 | The dictionary Junior shows a schedule for a junior year semester. The key is the course name and the value is the number of credits. 3 | Find the total number of credits taken this semester and assign it to the variable credits. Do not hardcode this – use dictionary 4 | accumulation! 5 | Solution: 6 | 7 | Junior = {'SI 206':4, 'SI 310':4, 'BL 300':3, 'TO 313':3, 'BCOM 350':1, 'MO 300':3} 8 | credits=0 9 | for key in Junior: 10 | credits+=Junior[key] 11 | print(credits) //18 12 | 13 | Question:2 14 | Create a dictionary, freq, that displays each character in string str1 as the key and its frequency as the value. 15 | Solution: 16 | 17 | str1 = "peter piper picked a peck of pickled peppers" 18 | freq={} 19 | for key in str1: 20 | if key not in freq: 21 | freq[key]=0 22 | freq[key]+=1 23 | print(freq) //{'p': 9, 'e': 8, 't': 1, 'r': 3, ' ': 7, 'i': 3, 'c': 3, 'k': 3, 'd': 2, 'a': 1, 'o': 1, 'f': 1, 'l': 1, 's': 1} 24 | 25 | 26 | Question:3 27 | Provided is a string saved to the variable name s1. Create a dictionary named counts that contains each letter in s1 and the number of 28 | times it occurs. 29 | Solution: 30 | 31 | s1 = "hello" 32 | counts={} 33 | for key in s1: 34 | if key not in counts: 35 | counts[key]=0 36 | counts[key]+=1 37 | print(counts) //{'e': 1, 'o': 1, 'l': 2, 'h': 1} 38 | 39 | 40 | Question:4 41 | Create a dictionary, freq_words, that contains each word in string str1 as the key and its frequency as the value. 42 | Solution: 43 | 44 | str1 = "I wish I wish with all my heart to fly with dragons in a land apart" 45 | lst=str1.split() 46 | freq_words={} 47 | for key in lst: 48 | if key not in freq_words: 49 | freq_words[key]=0 50 | freq_words[key]+=1 51 | print(freq_words) //{'I': 2, 'wish': 2, 'with': 2, 'all': 1, 'my': 1, 'heart': 1, 'to': 1, 'fly': 1, 'dragons': 1, 'in': 1, 'a': 1, 52 | 'land': 1, 'apart': 1} 53 | 54 | 55 | Question:5 56 | Create a dictionary called wrd_d from the string sent, so that the key is a word and the value is how many times you have seen that word. 57 | Solution: 58 | 59 | sent = "Singing in the rain and playing in the rain are two entirely different situations but both can be good" 60 | lst=sent.split() 61 | wrd_d={} 62 | for key in lst: 63 | if key not in wrd_d: 64 | wrd_d[key]=0 65 | wrd_d[key]+=1 66 | print(wrd_d) //{'in': 2, 'Singing': 1, 'the': 2, 'rain': 2, 'and': 1, 'playing': 1, 'are': 1, 'two': 1, 'entirely': 1, 'different': 1, 67 | 'situations': 1, 'but': 1, 'both': 1, 'can': 1, 'be': 1, 'good': 1} 68 | 69 | 70 | Question:6 71 | Create the dictionary characters that shows each character from the string sally and its frequency. Then, find the most frequent letter 72 | based on the dictionary. Assign this letter to the variable best_char. 73 | Solution: 74 | 75 | sally = "sally sells sea shells by the sea shore" 76 | characters={} 77 | for key in sally: 78 | if key not in characters: 79 | characters[key]=0 80 | characters[key]+=1 81 | val=characters.keys() 82 | best_char=val[0] 83 | for key in characters: 84 | if characters[key]>characters[best_char]: 85 | best_char=key 86 | print(characters) // {'a': 3, 's': 8, 'l': 6, 'y': 2, ' ': 7, 'e': 6, 'h': 3, 'b': 1, 't': 1, 'o': 1, 'r': 1} 87 | 88 | 89 | Question:7 90 | Find the least frequent letter. Create the dictionary characters that shows each character from string sally and its frequency. Then, 91 | find the least frequent letter in the string and assign the letter to the variable worst_char. 92 | Solution: 93 | 94 | sally = "sally sells sea shells by the sea shore and by the road" 95 | characters={} 96 | for key in sally: 97 | if key not in characters: 98 | characters[key]=0 99 | characters[key]+=1 100 | val=characters.keys() 101 | worst_char=val[0] 102 | for key in characters: 103 | if characters[key]=5: 46 | return "Longer than 5" 47 | else: 48 | return "Less than 5" 49 | print(length([1, 1, 1, 1, 1])) // Longer than 5 50 | 51 | 52 | Question:6 53 | You will need to write two functions for this problem. The first function, divide that takes in any number and returns that same number 54 | divided by 2. The second function called sum should take any number, divide it by 2, and add 6. It should return this new number. 55 | You should call the divide function within the sum function. Do not worry about decimals. 56 | Solution: 57 | 58 | def divide(num1): 59 | return num1/2 60 | def sum(num2): 61 | return divide(num2)+6 62 | -------------------------------------------------------------------------------- /COURSE_2:Python Functions, Files and Dictionaries/Week_3/Assesment_5: -------------------------------------------------------------------------------- 1 | Question:1 2 | Create a tuple called olympics with four elements: “Beijing”, “London”, “Rio”, “Tokyo”. 3 | Solution: 4 | 5 | olympics='Beijing', 'London', 'Rio', 'Tokyo' 6 | print(olympics) // ('Beijing', 'London', 'Rio', 'Tokyo') 7 | 8 | 9 | Question:2 10 | The list below, tuples_lst, is a list of tuples. Create a list of the second elements of each tuple and assign this list to the variable 11 | country. 12 | Solution: 13 | 14 | tuples_lst = [('Beijing', 'China', 2008), ('London', 'England', 2012), ('Rio', 'Brazil', 2016, 'Current'), ('Tokyo', 'Japan', 2020, 'Future')] 15 | country=[] 16 | for pair in tuples_lst: 17 | country.append(pair[1]) 18 | print(country) // ['China', 'England', 'Brazil', 'Japan'] 19 | 20 | 21 | Question:3 22 | With only one line of code, assign the variables city, country, and year to the values of the tuple olymp. 23 | Solution: 24 | 25 | olymp = ('Rio', 'Brazil', 2016) 26 | city, country,year=olymp 27 | print(city) // Rio 28 | print(country) // Brazil 29 | print(year) //2016 30 | 31 | 32 | Question:4 33 | Define a function called info with five parameters: name, gender, age, bday_month, and hometown. The function should then return a tuple 34 | with all five parameters in that order. 35 | Solution: 36 | 37 | def info(name, gender, age, bday_month,hometown): 38 | return name, gender, age, bday_month,hometown 39 | 40 | 41 | Question:5 42 | Given is the dictionary, gold, which shows the country and the number of gold medals they have earned so far in the 2016 Olympics. 43 | Create a list, num_medals, that contains only the number of medals for each country. You must use the .items() method. Note: The .items() 44 | method provides a list of tuples. Do not use .keys() method. 45 | Solution: 46 | 47 | 48 | gold = {'USA':31, 'Great Britain':19, 'China':19, 'Germany':13, 'Russia':12, 'Japan':10, 'France':8, 'Italy':8} 49 | num_medals=[] 50 | for pair in gold.items(): 51 | num_medals.append(pair[1]) 52 | print(num_medals) // [31, 19, 19, 13, 12, 10, 8, 8] 53 | 54 | -------------------------------------------------------------------------------- /COURSE_2:Python Functions, Files and Dictionaries/Week_4/Assessment_6: -------------------------------------------------------------------------------- 1 | Question:1 2 | Write a function, sublist, that takes in a list of numbers as the parameter. In the function, use a while loop to return a sublist of the 3 | input list. The sublist should contain the same values of the original list up until it reaches the number 5 (it should not contain the 4 | number 5). 5 | Solution: 6 | 7 | def sublist(lst): 8 | li=[] 9 | x=0 10 | if 5 not in lst: 11 | return lst 12 | while(lst[x]!=5): 13 | li.append(lst[x]) 14 | x+=1 15 | return li 16 | print(sublist([8, 6, 5])) // [8, 6] 17 | 18 | 19 | Question:2 20 | Write a function called check_nums that takes a list as its parameter, and contains a while loop that only stops once the element of the 21 | list is the number 7. What is returned is a list of all of the numbers up until it reaches 7. 22 | Solution: 23 | 24 | def check_nums(lst): 25 | li=[] 26 | x=0 27 | if 7 not in lst: 28 | return lst 29 | while(lst[x]!=7): 30 | li.append(lst[x]) 31 | x+=1 32 | return li 33 | print(check_nums([0,2,4,9,2,3,6,8,12,14,7,9,10,8,3])) // [0, 2, 4, 9, 2, 3, 6, 8, 12, 14] 34 | 35 | 36 | Question:3 37 | Write a function, sublist, that takes in a list of strings as the parameter. In the function, use a while loop to return a sublist of the 38 | input list. The sublist should contain the same values of the original list up until it reaches the string “STOP” (it should not contain 39 | the string “STOP”). 40 | Solution: 41 | 42 | def sublist(lst): 43 | x=0 44 | li=[] 45 | while lst[x]!='STOP': 46 | li.append(lst[x]) 47 | x+=1 48 | return li 49 | print(sublist(['jackie', 'paul', 'STOP'])) //['jackie', 'paul'] 50 | 51 | 52 | Question:4 53 | Write a function called stop_at_z that iterates through a list of strings. Using a while loop, append each string to a new list until 54 | the string that appears is “z”. The function should return the new list. 55 | Solution: 56 | 57 | 58 | def stop_at_z(lst): 59 | x=0 60 | li=[] 61 | while lst[x]!='z': 62 | li.append(lst[x]) 63 | x+=1 64 | return li 65 | print(stop_at_z(['zoo', 'zika', 'ozzie', 'pizzazz', 'z', 'pizza', 'zap', 'haze'])) // ['zoo', 'zika', 'ozzie', 'pizzazz'] 66 | 67 | Question:5 68 | Below is a for loop that works. Underneath the for loop, rewrite the problem so that it does the same thing, but using a while loop 69 | instead of a for loop. Assign the accumulated total in the while loop code to the variable sum2. Once complete, sum2 should equal sum1. 70 | Solution: 71 | 72 | 73 | sum1 = 0 74 | lst = [65, 78, 21, 33] 75 | for x in lst: 76 | sum1 = sum1 + x 77 | sum2=0 78 | x=0 79 | while(x10: 97 | return li[:10] 98 | else: 99 | return li[:len(li)] 100 | print(beginning(['water', 'phone', 'home', 'chapstick', 'market', 'headphones', 'bye', 'stickie notes', 'snapchat', 'facebook', 101 | 'social media'])) // ['water', 'phone', 'home', 'chapstick', 'market', 'headphones'] 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /COURSE_2:Python Functions, Files and Dictionaries/Week_4/Assessment_7: -------------------------------------------------------------------------------- 1 | Question:1 2 | Create a function called mult that has two parameters, the first is required and should be an integer, the second is an optional parameter 3 | that can either be a number or a string but whose default is 6. The function should return the first parameter multiplied by the second. 4 | Solution: 5 | def mult(num,opt=6): 6 | return num*opt 7 | print(mult(2)) //12 8 | 9 | Question:2 10 | The following function, greeting, does not work. Please fix the code so that it runs without error. This only requires one change in the 11 | definition of the function. 12 | Solution: 13 | 14 | def greeting( name,greeting="Hello ", excl="!"): 15 | return greeting + name + excl 16 | 17 | print(greeting("Bob")) 18 | print(greeting("")) 19 | print(greeting("Bob", excl="!!!")) // Hello Bob!!! 20 | 21 | 22 | Question:3 23 | Below is a function, sum, that does not work. Change the function definition so the code works. The function should still have a 24 | required parameter, intx, and an optional parameter, intz with a defualt value of 5. 25 | Solution: 26 | 27 | def sum( intx,intz=5): 28 | return intz + intx 29 | print(sum(8,2)) // 10 30 | 31 | 32 | Question:4 33 | Write a function, test, that takes in three parameters: a required integer, an optional boolean whose default value is True, and an 34 | optional dictionary, called dict1, whose default value is {2:3, 4:5, 6:8}. If the boolean parameter is True, the function should test to 35 | see if the integer is a key in the dictionary. The value of that key should then be returned. If the boolean parameter is False, return 36 | the boolean value “False”. 37 | Solution: 38 | 39 | def test(num,bol=True,dict1={2:3, 4:5, 6:8}): 40 | if bol==True: 41 | if num in dict1: 42 | return dict1[num] 43 | else: 44 | return False 45 | print(test(2)) // 3 46 | print(test(4,False)) // False 47 | 48 | Question:5 49 | Write a function called checkingIfIn that takes three parameters. The first is a required parameter, which should be a string. The second 50 | is an optional parameter called direction with a default value of True. The third is an optional parameter called d that has a default 51 | value of {'apple': 2, 'pear': 1, 'fruit': 19, 'orange': 5, 'banana': 3, 'grapes': 2, 'watermelon': 7}. Write the function checkingIfIn 52 | so that when the second parameter is True, it checks to see if the first parameter is a key in the third parameter; if it is, return 53 | True, otherwise return False. 54 | But if the second paramter is False, then the function should check to see if the first parameter is not a key of the third. If it’s not, 55 | the function should return True in this case, and if it is, it should return False. 56 | Solution: 57 | 58 | def checkingIfIn(string,direction=True,d={'apple': 2, 'pear': 1, 'fruit': 19, 'orange': 5, 'banana': 3, 'grapes': 2, 'watermelon': 7}): 59 | if direction==True: 60 | if string in d: 61 | return True 62 | else: 63 | return False 64 | else: 65 | if string not in d: 66 | return True 67 | else: 68 | return False 69 | print(checkingIfIn('grapes')) // True 70 | 71 | 72 | Question:6 73 | We have provided the function checkingIfIn such that if the first input parameter is in the third, dictionary, input parameter, then the 74 | function returns that value, and otherwise, it returns False. Follow the instructions in the active code window for specific variable 75 | assignmemts. 76 | Solution: 77 | 78 | 79 | def checkingIfIn(a, direction = True, d = {'apple': 2, 'pear': 8, 'fruit': 19, 'orange': 5, 'banana': 3, 'grapes': 2, 'watermelon': 7}): 80 | if direction == True: 81 | if a in d: 82 | return d[a] 83 | else: 84 | return False 85 | else: 86 | if a not in d: 87 | return True 88 | else: 89 | return d[a] 90 | 91 | # Call the function so that it returns False and assign that function call to the variable c_false 92 | c_false=checkingIfIn('Mango') 93 | print(c_false) //False 94 | 95 | # Call the fucntion so that it returns True and assign it to the variable c_true 96 | c_true=checkingIfIn('Mango',False) 97 | print(c_true) // True 98 | 99 | # Call the function so that the value of fruit is assigned to the variable fruit_ans 100 | fruit_ans=checkingIfIn('fruit') 101 | print(fruit_ans) // 19 102 | 103 | # Call the function using the first and third parameter so that the value 8 is assigned to the variable param_check 104 | param_check=checkingIfIn('pear') 105 | print(param_check) // 8 106 | -------------------------------------------------------------------------------- /COURSE_2:Python Functions, Files and Dictionaries/Week_5/Assessment_8: -------------------------------------------------------------------------------- 1 | Question:1 Sort the following string alphabetically, from z to a, and assign it to the variable sorted_letters. 2 | Solution: 3 | 4 | letters = "alwnfiwaksuezlaeiajsdl" 5 | sorted_letters=sorted(letters,reverse=True) 6 | print(sorted_letters) // ['z', 'w', 'w', 'u', 's', 's', 'n', 'l', 'l', 'l', 'k', 'j', 'i', 'i', 'f', 'e', 'e', 'd', 'a', 'a', 'a', 'a'] 7 | 8 | Question:2 9 | Sort the list below, animals, into alphabetical order, a-z. Save the new list as animals_sorted. 10 | Solution: 11 | 12 | 13 | animals = ['elephant', 'cat', 'moose', 'antelope', 'elk', 'rabbit', 'zebra', 'yak', 'salamander', 'deer', 'otter', 'minx', 'giraffe', 14 | 'goat', 'cow', 'tiger', 'bear'] 15 | animals_sorted=sorted(animals) 16 | print(animals_sorted) // ['antelope', 'bear', 'cat', 'cow', 'deer', 'elephant', 'elk', 'giraffe', 'goat', 'minx', 'moose', 'otter', 17 | 'rabbit', 'salamander', 'tiger', 'yak', 'zebra'] 18 | 19 | 20 | Question:3 21 | The dictionary, medals, shows the medal count for six countries during the Rio Olympics. Sort the country names so they appear 22 | alphabetically. Save this list to the variable alphabetical. 23 | Solution: 24 | 25 | medals = {'Japan':41, 'Russia':56, 'South Korea':21, 'United States':121, 'Germany':42, 'China':70} 26 | alphabetical=sorted(medals) 27 | print(alphabetical) // ['China', 'Germany', 'Japan', 'Russia', 'South Korea', 'United States'] 28 | 29 | 30 | Question:4 31 | Given the same dictionary, medals, now sort by the medal count. Save the three countries with the highest medal count to the list, 32 | top_three. 33 | Solution: 34 | 35 | medals = {'Japan':41, 'Russia':56, 'South Korea':21, 'United States':121, 'Germany':42, 'China':70} 36 | alphabetical=list(sorted(medals,key=lambda count:medals[count],reverse=True))[:3] 37 | print(alphabetical) // ['United States', 'China', 'Russia'] 38 | 39 | 40 | Question:5 41 | We have provided the dictionary groceries. You should return a list of its keys, but they should be sorted by their values, from highest 42 | to lowest. Save the new list as most_needed. 43 | Solution: 44 | 45 | groceries = {'apples': 5, 'pasta': 3, 'carrots': 12, 'orange juice': 2, 'bananas': 8, 'popcorn': 1, 'salsa': 3, 'cereal': 4, 'coffee': 5, 'granola bars': 15, 'onions': 7, 'rice': 1, 'peanut butter': 2, 'spinach': 9} 46 | most_needed=sorted(groceries,key=lambda cnt:groceries[cnt],reverse=True) 47 | print(most_needed) // ['granola bars', 'carrots', 'spinach', 'bananas', 'onions', 'coffee', 'apples', 'cereal', 'salsa', 'pasta', 48 | 'peanut butter', 'orange juice', 'rice', 'popcorn'] 49 | 50 | 51 | Question:6 52 | Create a function called last_four that takes in an ID number and returns the last four digits. For example, the number 17573005 should 53 | return 3005. Then, use this function to sort the list of ids stored in the variable, ids, from lowest to highest. Save this sorted list 54 | in the variable, sorted_ids. Hint: Remember that only strings can be indexed, so conversions may be needed. 55 | Solution: 56 | 57 | def last_four(x): 58 | x=str(x) 59 | return x[-4:] 60 | ids = [17573005, 17572342, 17579000, 17570002, 17572345, 17579329] 61 | c='17573005' 62 | sorted_ids=sorted(ids,key=lambda num:last_four(num)) 63 | print(sorted_ids) // [17570002, 17572342, 17572345, 17573005, 17579000, 17579329] 64 | 65 | 66 | Question:7 67 | Sort the list ids by the last four digits of each id. Do this using lambda and not using a defined function. Save this sorted list in the 68 | variable sorted_id. 69 | Solution: 70 | 71 | 72 | ids = [17573005, 17572342, 17579000, 17570002, 17572345, 17579329] 73 | id= [str (n) for n in ids] 74 | sorted_id=sorted(id,key=lambda num:num[-4:]) 75 | sorted_id=[int(n) for n in sorted_id] 76 | print(sorted_id) // [17570002, 17572342, 17572345, 17573005, 17579000, 17579329] 77 | 78 | 79 | Question:8 80 | Sort the following list by each element’s second letter a to z. Do so by using lambda. Assign the resulting value to the variable 81 | lambda_sort. 82 | Solution: 83 | 84 | 85 | ex_lst = ['hi', 'how are you', 'bye', 'apple', 'zebra', 'dance'] 86 | lambda_sort=sorted(ex_lst,key=lambda x:x[1]) 87 | print(lambda_sort) // ['dance', 'zebra', 'hi', 'how are you', 'apple', 'bye'] 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /COURSE_2:Python Functions, Files and Dictionaries/Week_5/Course_2 Project: -------------------------------------------------------------------------------- 1 | #TASK-1 2 | 3 | We have provided some synthetic (fake, semi-randomly generated) twitter data in a csv file named project_twitter_data.csv which has the 4 | text of a tweet, the number of retweets of that tweet, and the number of replies to that tweet. We have also words that express positive 5 | sentiment and negative sentiment, in the files positive_words.txt and negative_words.txt. 6 | 7 | Your task is to build a sentiment classifier, which will detect how positive or negative each tweet is. You will create a csv file, 8 | which contains columns for the Number of Retweets, Number of Replies, Positive Score (which is how many happy words are in the tweet), 9 | Negative Score (which is how many angry words are in the tweet), and the Net Score for each tweet. At the end, you upload the csv file to 10 | Excel or Google Sheets, and produce a graph of the Net Score vs Number of Retweets. 11 | 12 | To start, define a function called strip_punctuation which takes one parameter, a string which represents a word, and removes 13 | characters considered punctuation from everywhere in the word. (Hint: remember the .replace() method for strings.) 14 | 15 | SOLUTION: 16 | punctuation_chars = ["'", '"', ",", ".", "!", ":", ";", '#', '@'] 17 | 18 | def strip_punctuation(string): 19 | for char in string: 20 | if char in punctuation_chars: 21 | string=string.replace(char,'') 22 | print(string) 23 | return(string) 24 | 25 | #TASK-2 26 | 27 | Next, copy in your strip_punctuation function and define a function called get_pos which takes one parameter, a string which represents 28 | one or more sentences, and calculates how many words in the string are considered positive words. Use the list, positive_words to 29 | determine what words will count as positive. The function should return a positive integer - how many occurrences there are of positive 30 | words in the text. Note that all of the words in positive_words are lower cased, so you’ll need to convert all the words in the input 31 | string to lower case as well. 32 | 33 | SOLUTION: 34 | 35 | 36 | punctuation_chars = ["'", '"', ",", ".", "!", ":", ";", '#', '@'] 37 | # list of positive words to use 38 | positive_words = [] 39 | with open("positive_words.txt") as pos_f: 40 | for lin in pos_f: 41 | if lin[0] != ';' and lin[0] != '\n': 42 | positive_words.append(lin.strip()) 43 | #print(positive_words) 44 | def strip_punctuation(string): 45 | for char in string: 46 | if char in punctuation_chars: 47 | string=string.replace(char,'') 48 | return(string) 49 | 50 | def get_pos(sentence): 51 | sentence=sentence.lower() 52 | sent_list=sentence.split(" ") 53 | count=0 54 | for word in sent_list: 55 | word=strip_punctuation(word) 56 | if word in positive_words: 57 | count+=1 58 | return count 59 | 60 | #TASK-3 61 | Next, copy in your strip_punctuation function and define a function called get_neg which takes one parameter, a string which represents 62 | one or more sentences, and calculates how many words in the string are considered negative words. Use the list, negative_words to 63 | determine what words will count as negative. The function should return a positive integer - how many occurrences there are of negative 64 | words in the text. Note that all of the words in negative_words are lower cased, so you’ll need to convert all the words in the input 65 | string to lower case as well. 66 | 67 | SOLUTION: 68 | 69 | 70 | punctuation_chars = ["'", '"', ",", ".", "!", ":", ";", '#', '@'] 71 | 72 | negative_words = [] 73 | with open("negative_words.txt") as pos_f: 74 | for lin in pos_f: 75 | if lin[0] != ';' and lin[0] != '\n': 76 | negative_words.append(lin.strip()) 77 | 78 | def strip_punctuation(string): 79 | for char in string: 80 | if char in punctuation_chars: 81 | string=string.replace(char,'') 82 | return(string) 83 | 84 | def get_neg(sentence): 85 | sentence=sentence.lower() 86 | sent_list=sentence.split(" ") 87 | count=0 88 | for word in sent_list: 89 | word=strip_punctuation(word) 90 | if word in negative_words: 91 | count+=1 92 | return count 93 | 94 | 95 | #TASK-4 96 | Finally, copy in your previous functions and write code that opens the file project_twitter_data.csv which has the fake generated 97 | twitter data (the text of a tweet, the number of retweets of that tweet, and the number of replies to that tweet). Your task is to build 98 | a sentiment classifier, which will detect how positive or negative each tweet is. Copy the code from the code windows above, and put 99 | that in the top of this code window. Now, you will write code to create a csv file called resulting_data.csv, which contains the Number 100 | of Retweets, Number of Replies, Positive Score (which is how many happy words are in the tweet), Negative Score (which is how many angry 101 | words are in the tweet), and the Net Score (how positive or negative the text is overall) for each tweet. The file should have those 102 | headers in that order. Remember that there is another component to this project. You will upload the csv file to Excel or Google Sheets 103 | and produce a graph of the Net Score vs Number of Retweets. Check Coursera for that portion of the assignment, if you’re accessing this 104 | textbook from Coursera. 105 | 106 | SOLUTION: 107 | 108 | 109 | punctuation_chars = ["'", '"', ",", ".", "!", ":", ";", '#', '@'] 110 | # lists of words to use 111 | positive_words = [] 112 | with open("positive_words.txt") as pos_f: 113 | for lin in pos_f: 114 | if lin[0] != ';' and lin[0] != '\n': 115 | positive_words.append(lin.strip()) 116 | 117 | 118 | negative_words = [] 119 | with open("negative_words.txt") as pos_f: 120 | for lin in pos_f: 121 | if lin[0] != ';' and lin[0] != '\n': 122 | negative_words.append(lin.strip()) 123 | 124 | def strip_punctuation(string): 125 | for char in string: 126 | if char in punctuation_chars: 127 | string=string.replace(char,'') 128 | return(string) 129 | 130 | def get_neg(sentence): 131 | sentence=sentence.lower() 132 | sent_list=sentence.split(" ") 133 | count=0 134 | for word in sent_list: 135 | word=strip_punctuation(word) 136 | if word in negative_words: 137 | count+=1 138 | return count 139 | 140 | 141 | 142 | def get_pos(sentence): 143 | sentence=sentence.lower() 144 | sent_list=sentence.split(" ") 145 | count=0 146 | for word in sent_list: 147 | word=strip_punctuation(word) 148 | if word in positive_words: 149 | count+=1 150 | return count 151 | 152 | tweet_file=open('project_twitter_data.csv','r') 153 | final_li=[] 154 | 155 | for tw in tweet_file.readlines()[1:]: 156 | new_sen=[1,1,1,1,1] 157 | li=tw.split(',') 158 | #print(li) 159 | new_sen[0]=int(li[1]) 160 | string=li[2] 161 | new_sen[1]=int(string[:-1]) 162 | new_sen[2]=get_pos(li[0]) 163 | new_sen[3]=get_neg(li[0]) 164 | new_sen[4]=new_sen[2]-new_sen[3] 165 | final_li.append(new_sen) 166 | tweet_file.close() 167 | #print(final_li) 168 | #final_li=[[3, 0, 0, 0, 0], [1, 0, 2, 2, 4], [1, 2, 1, 0, 1], [3, 1, 1, 0, 1], [6, 0, 2, 0, 2], [9, 5, 2, 0, 2], [19, 0, 2, 0, 2], [0, 0, 0, 3, -3], [0, 0, 0, 2, 2], [82, 2, 4, 0, 4], [0, 0, 0, 1, 1], [0, 0, 1, 0, 1], [47, 0, 2, 0, 2], [2, 1, 1, 0, 1], [0, 2, 1, 0, 1], [0, 0, 2, 1, 3], [4, 6, 3, 0, 3], [19, 0, 3, 1, 4], [0, 0, 1, 1, 2]] 169 | 170 | x=[ele[4] for ele in final_li] 171 | y=[ele[0] for ele in final_li] 172 | print(x) 173 | print(y) 174 | filename = 'resulting_data.csv' 175 | outfile = open(filename, "w") 176 | outfile.write('Number of Retweets, Number of Replies, Positive Score, Negative Score, Net Score') 177 | outfile.write('\n') 178 | for result in final_li: 179 | row_string='{},{},{},{},{}'.format(result[0],result[1],result[2],result[3],result[4]) 180 | outfile.write(row_string+ "\n") 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /COURSE_2:Python Functions, Files and Dictionaries/Week_5/Sentiment_Analysis(Part_2).ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "Sentiment Analysis(Part:-2)", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | } 13 | }, 14 | "cells": [ 15 | { 16 | "cell_type": "code", 17 | "metadata": { 18 | "id": "o4n3MyUjjLq2", 19 | "colab_type": "code", 20 | "colab": {} 21 | }, 22 | "source": [ 23 | "from matplotlib import pyplot as plt \n" 24 | ], 25 | "execution_count": 0, 26 | "outputs": [] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "metadata": { 31 | "id": "daAZ5xIhotyE", 32 | "colab_type": "code", 33 | "outputId": "589b9a24-46b4-45fa-919d-c83c2f067e7b", 34 | "colab": { 35 | "base_uri": "https://localhost:8080/", 36 | "height": 316 37 | } 38 | }, 39 | "source": [ 40 | "x=[0, 0, 1, 1, 2, 2, 2, -3, -2, 4, -1, 1, 2, 1, 1, 1, 3, 2, 0]\n", 41 | "y=[3, 1, 1, 3, 6, 9, 19, 0, 0, 82, 0, 0, 47, 2, 0, 0, 4, 19, 0]\n", 42 | "fig = plt.figure()\n", 43 | "plt.scatter(x, y) \n", 44 | "fig.suptitle('Sample Sentiment Analysis Result', fontsize=20)\n", 45 | "plt.xlabel('No. of Retweets', fontsize=18)\n", 46 | "plt.ylabel('Net Sentiment Score', fontsize=16)\n", 47 | "plt.grid()" 48 | ], 49 | "execution_count": 2, 50 | "outputs": [ 51 | { 52 | "output_type": "display_data", 53 | "data": { 54 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAErCAYAAAA8K++RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3dffzdc/3H8cfTGsbKXC5mmYRcLBebq59iQ+GXMroi+SGlkqK02qLIRcSvC/XLr5CoaPqV6wjZpihkjRZaYcTmIjGMYeb1++P9PpydnXO+n/P9nkt73m+3c/t+z+fy9Tnncz6vz/vi8/koIjAzs2Xbcp0OwMzMOs/JwMzMnAzMzMzJwMzMcDIwMzOcDMzMDCeDjpN0nqSQNKrTsXQTfy7dS9LB+bs5uE3r875Qg6T7Jd3fjGV1dTKQNEjSxyXdIOkJSYskPSbpL5LOkfTeTsfYCyQNk3SCpNslLZD0gqS5km6W9E1JW3UgpuPzD3xcu9fdTs06cEo6Ji8nJG3cpPCWaZLGlX2mpdciSfMkXSxpp07H2B/93ede16J4BkzSIOB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YmZmTgZmZ4WRgZmY4GZiZGU4GZmaGk4GZmeFkYGZmOBmYmRlOBmZmhpOBmZkB/w+LE2V2tBE/igAAAABJRU5ErkJggg==\n", 55 | "text/plain": [ 56 | "
" 57 | ] 58 | }, 59 | "metadata": { 60 | "tags": [], 61 | "needs_background": "light" 62 | } 63 | } 64 | ] 65 | }, 66 | { 67 | "cell_type": "code", 68 | "metadata": { 69 | "id": "jLO68MjjovYU", 70 | "colab_type": "code", 71 | "colab": {} 72 | }, 73 | "source": [ 74 | "" 75 | ], 76 | "execution_count": 0, 77 | "outputs": [] 78 | } 79 | ] 80 | } -------------------------------------------------------------------------------- /COURSE_4:Python Classes and Inheritance/README.md: -------------------------------------------------------------------------------- 1 | The folders contain the respective assignments from the three weeks of the Course-4 of Specialization in Python-3-Programming. 2 | -------------------------------------------------------------------------------- /COURSE_4:Python Classes and Inheritance/Week_1/t: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /COURSE_4:Python Classes and Inheritance/Week_3/asses_3(ques): -------------------------------------------------------------------------------- 1 | Question:1 2 | The function mySum is supposed to return the sum of a list of numbers (and 0 if that list is empty), but it has one or more errors in it. 3 | Use this space to write test cases to determine what errors there are.You will be using this information to answer the next set of 4 | multiple choice questions. 5 | 6 | Question:2 7 | The class Student is supposed to accept two arguments in its constructor: 8 | A name string 9 | 10 | An optional integer representing the number of years the student has been at Michigan (default:1) 11 | 12 | Every student has three instance variables: 13 | self.name (set to the name provided) 14 | 15 | self.years_UM (set to the number of years the student has been at Michigan) 16 | 17 | self.knowledge (initialized to 0) 18 | 19 | There are three methods: 20 | .study() should increase self.knowledge by 1 and return None 21 | 22 | .getKnowledge() should return the value of self.knowledge 23 | 24 | .year_at_umich() should return the value of self.years_UM 25 | 26 | There are one or more errors in the class. Use this space to write test cases to determine what errors there are. You will be using this information to answer the next set of multiple choice questions. 27 | 28 | -------------------------------------------------------------------------------- /COURSE_4:Python Classes and Inheritance/Week_3/asses_4(ques): -------------------------------------------------------------------------------- 1 | Question:1 2 | The code below takes the list of country, country, and searches to see if it is in the dictionary gold which shows some countries who won 3 | gold during the Olympics. However, this code currently does not work. Correctly add try/except clause in the code so that it will 4 | correctly populate the list, country_gold, with either the number of golds won or the string “Did not get gold”. 5 | 6 | Question:2 7 | Provided is a buggy for loop that tries to accumulate some values out of some dictionaries. Insert a try/except so that the code passes. 8 | 9 | Question:3 10 | The list, numb, contains integers. Write code that populates the list remainder with the remainder of 36 divided by each number in numb. 11 | For example, the first element should be 0, because 36/6 has no remainder. If there is an error, have the string “Error” appear in the 12 | remainder. 13 | 14 | 15 | Question:4 16 | Provided is buggy code, insert a try/except so that the code passes. 17 | 18 | Question:5 19 | Write code so that the buggy code provided works using a try/except. When the codes does not work in the try, have it append to the list 20 | attempt the string “Error”. 21 | 22 | Question:6 23 | The following code tries to append the third element of each list in conts to the new list third_countries. Currently, the code does not 24 | work. Add a try/except clause so the code runs without errors, and the string ‘Continent does not have 3 countries’ is appended to 25 | countries instead of producing an error. 26 | 27 | Question:7 28 | The buggy code below prints out the value of the sport in the list sport. Use try/except so that the code will run properly. 29 | If the sport is not in the dictionary, ppl_play, add it in with the value of 1. 30 | 31 | Question:8 32 | Provided is a buggy for loop that tries to accumulate some values out of some dictionaries. Insert a try/except so that the code passes. 33 | If the key is not there, initialize it in the dictionary and set the value to zero. 34 | -------------------------------------------------------------------------------- /COURSE_5:Python Project: Pillow, tesseract, and opencv/Week_3/ReadMe.md: -------------------------------------------------------------------------------- 1 | The Project 2 | This is a project with minimal scaffolding. Expect to use the the discussion forums to gain insights! It’s not cheating to ask others for opinions or perspectives! 3 | Be inquisitive, try out new things. 4 | Use the previous modules for insights into how to complete the functions! You'll have to combine Pillow, OpenCV, and Pytesseract 5 | There are hints provided in Coursera, feel free to explore the hints if needed. Each hint provide progressively more details on how to solve the issue. This project is intended to be comprehensive and difficult if you do it without the hints. 6 | The Assignment 7 | Take a ZIP file of images and process them, using a library built into python that you need to learn how to use. A ZIP file takes several different files and compresses them, thus saving space, into one single file. The files in the ZIP file we provide are newspaper images (like you saw in week 3). Your task is to write python code which allows one to search through the images looking for the occurrences of keywords and faces. E.g. if you search for "pizza" it will return a contact sheet of all of the faces which were located on the newspaper page which mentions "pizza". This will test your ability to learn a new (library), your ability to use OpenCV to detect faces, your ability to use tesseract to do optical character recognition, and your ability to use PIL to composite images together into contact sheets. 8 | 9 | Each page of the newspapers is saved as a single PNG image in a file called images.zip. These newspapers are in english, and contain a variety of stories, advertisements and images. Note: This file is fairly large (~200 MB) and may take some time to work with, I would encourage you to use small_img.zip for testing. 10 | 11 | Here's an example of the output expected. Using the small_img.zip file, if I search for the string "Christopher" I should see the following image:Christopher SearchIf I were to use the images.zip file and search for "Mark" I should see the following image (note that there are times when there are no faces on a page, but a word is found!):Mark Search 12 | 13 | Note: That big file can take some time to process - for me it took nearly ten minutes! Use the small one for testing. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # COURSERA-Python-3-Programmming- 2 | It is a specialization course of Python in coursera hosted by **University of Michigan**. 3 | It contains 5 courses within it: 4 | 5 | 1:Basics of Python 6 | 7 | 2:Python Functions, Files and Dictionaries 8 | 9 | 3:Data Collection and Processing with Python 10 | 11 | 4:Python Classes and Inheritance 12 | 13 | 5:Python Project: Pillow, Tesseract, and OpenCV 14 | 15 | --------------------------------------------------------------------------------