blob_id
stringlengths
40
40
repo_name
stringlengths
5
127
path
stringlengths
2
523
length_bytes
int64
22
545k
score
float64
3.5
5.34
int_score
int64
4
5
text
stringlengths
22
545k
1d79b77b523389ebee91680fb2b561c966b22016
Euler-Project-Colab/Project-Euler
/problem10_neel.py
956
3.734375
4
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jul 29 17:12:56 2020 @author: neel """ """ Program to calculate sum of all Prime numbers less than 20000000 Note: Python libraries are superfast, always implement them wherever possible """ import sympy import time import numpy as np t=time.time...
2a41c7e7daa757da63509df059f027e044574cd2
Euler-Project-Colab/Project-Euler
/problem4_tanay.py
328
3.890625
4
greatest = 0 for num1 in range(100,1000): #finds product of all 3 digits numbers for num2 in range(100,1000): product = num1*num2 if str(product) == str(product)[::-1] and product>greatest: #checks if product is palindrome greatest = product print(greatest) #ans...
a2b419084bafcc112f88f99a6d3bd327db5e983d
Python-lab-cycle/jeri
/string,py.py
130
4.09375
4
str1= input("Enter the string:") print("String after swapping first and last character:",(str1[-1:] + str1[1:-1] + str1[:1]))
1e771bd8f9fc6ca26a9575a892f0a3c9ba5864c0
Python-lab-cycle/jeri
/largest1.py
167
3.921875
4
a=int(input("Enter the first number")) b=int(input("Enter the second number")) c=int(input("Enter the third number")) big=max(a,b,c) print("Largest number=",big)
cf7baf68cf0e24c45dd48a47ea1b0e2b114304a5
amitwats/toy-robot-on-table
/table.py
1,138
4.03125
4
import utility class Table: """The class that represents the table on which the Robot is kept. """ def __init__(self,count_x=5,count_y=5): """The constructor Arguments: count_x {int} -- The number of squares on the table on the x-axis. (default=5) count_...
421758619c755c68a9eab48db5f268875f2d748d
amitwats/toy-robot-on-table
/robot.py
3,885
4.3125
4
from direction import Directions import utility class Robot: """The class represents the Robot. The main parameters are direction - This is the direction in which the Robot is facing and can move in if move command is called. x_pos - The current x position(0-Indexed) of the Robot on the table. ...
7eb00d5cde0db196e7354ffe2480d22c3dcbf1e2
kailee-madden/Data-Science
/kmadden5-hw1-programming/kmadden5-hw1-2-3.py
973
3.546875
4
#!/usr/bin/env python3 import matplotlib.pyplot as plt import pandas from pandas import Series, DataFrame import numpy as np D = pandas.read_csv("Dataset-film-data.csv") A = [] C = [] R = [] for index, row in D.iterrows(): if row["GENRE"] == "ROMANCE": R.append(row["AVGRATING_WEBSITE_1"]) elif ro...
83c51994945f1fc21ad3cd97c257143b23604909
LukaszRams/WorkTimer
/applications/database/tables.py
1,559
4.15625
4
#!/usr/bin/python # -*- coding: utf-8 -*- """ This file will store the data for the database queries that will be called to create the database """ # Table of how many hours an employee should work per month class Monthly_working_time: table_name = "MONTHLY_WORKING_TIME" data = { "id": ("integer", "...
3c856ac8d28b260a2906f6f1404ac0fe91f5cf0a
saiduc/Calculating-Pi-With-Collisions
/picalc.py
3,799
3.984375
4
from fractions import Fraction import argparse class block: def __init__(self, position, mass): self.x = position # block position self.m = mass # block mass self.v = Fraction(0, 1) # block velocity def reflect(self): """ reverses velocity for elast...
61b8af60be81eabf43772e6f24e77b5422e5fbb8
Eladfundo/m101p
/01_Introduction/fruits.py
135
4.0625
4
fruits = ['apple', 'pear', 'banana'] new_fruits = [] for item in fruits: print item new_fruits.append(item) print new_fruits
138e4d255a76da4d6ddceb6936b1bf58342348c0
kelsiehargita/Python-Challenge
/PyBank/main.py
2,105
3.5
4
import os import csv csvpath = os.path.join('.', 'Resources', 'budget_data.csv') with open(csvpath) as csvfile: csvreader = csv.reader(csvfile, delimiter=',') print(csvreader) csv_header = next(csvreader) number_of_months = 0 net_total = 0 previous_profit = 0 total_profit_change = 0 ...
9e1f9ad4df8273b5424331171a482210ac26f073
NamLa7499/convert_pencil
/pencil_convert.py
571
3.578125
4
import cv2 # get the image location img_location = 'D:\\' filename = 'test.jpg' #read in the image img = cv2.imread(img_location+filename) #convert gray_image = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) #invert the image inverted_gray_image = 255 - gray_image #blur the image by gauss blurred_img = cv2.GaussianBl...
1fb91f30505cd5788789aece21d26f6dded67255
snehadujaniya/SIH-2020
/Scripts/future predict.py
1,122
3.640625
4
import pandas as pd import numpy as np import matplotlib.pyplot as plt #2. Import the datetime library and use 'datetime' function: from datetime import datetime # Now, we will load the data set and look at some initial rows and data types of the columns: plt.figure(figsize=(20,10)) # The data contains a particular mon...
4c7a2abd22c9836f841454dbf15f74ff1b8686f5
johnflavin/hanging
/hanging.py
4,200
3.734375
4
import sys import csv from string import ascii_uppercase as upperc target = sys.argv[1] target = target.upper() wordlen = len(target) char_per_line = 100 def print_words(word_list,word_length): num_words = len(word_list) #words/line = (chars/line) / (chars/word including a space) words_per_line = int(char_per_lin...
14ec0c44b73f099627cc5b6c488fe694dd32ceda
Silentsoul04/FTSP_2020
/Summer Training ML & DL/Classification_KNN.py
2,213
3.84375
4
# Import the Libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt # To Import csv file dataset = pd.read_csv('E:\ML Code Challenges\ML CSV Files\caesarian.csv') dataset.head() ------------------- Age DeliveryNumber DeliveryTime BloodPressure HeartProblem Caesarian 0 22 ...
3c0a8d993d3c7ac14489e252b3a2cbaa5f508b93
Silentsoul04/FTSP_2020
/Extra Lockdown Tasks/Copy()_Method_Python.py
393
4.0625
4
''' Copy() Method in Python :- --------------------------- ''' l1 = [10,20,30,40,50] l2 = l1 print(l1) print(l2) l1.append(99) print(l1) print(l2) l2.remove(20) print(l1) print(l2) # copy() method l1 = [10,20,30,40] l2 = l1.copy() print(l1) --- > Original list1 print(l2) ---> Dulpicate list2 -->shallow l2.ap...
9791c4c5ee8e950342e21d73e372315203fe9bac
Silentsoul04/FTSP_2020
/Hacker Rank/Day6_Strings.py
911
3.5
4
# -*- coding: utf-8 -*- """ Created on Sat Feb 8 07:43:01 2020 @author: Rajesh """ s = 'RAJESH' list1 = s.split() print(list1) ##################### list1=[] s = 'RAJESH' for i in s: list1.append(i) print(list1) ########################## s = 'RAJESH KUMAR SHARMA' cnt = s.count('R') print(cnt) ############...
834fd97da46558ba454a7f7b8d7756f67366b080
Silentsoul04/FTSP_2020
/Durga OOPs/Operator_Overloading1_OOPs.py
6,817
4.125
4
# -*- coding: utf-8 -*- """ Created on Wed Feb 26 18:17:57 2020 @author: Rajesh """ Operator Overloading :- -------------------- class Book: def __init__(self,pages): self.pages = pages def __add__(self,other): return self.pages + other.pages b1 = Book(100) b2 = Book(200) ...
a09833e63f1fd9b89778cacfda01331b0dd5888d
Silentsoul04/FTSP_2020
/Durga OOPs/Method_Overriding_OOPs.py
3,038
4.1875
4
# -*- coding: utf-8 -*- """ Created on Thu Feb 27 19:14:46 2020 @author: Rajesh """ Method Overriding :- ----------------- Inheritance :- ----------- class P: 10 methods are there class C extends P: # In Java child class created. 5 more methods are there class C(P): # In Python child class created. 5 m...
a1e5fef7ebf21e348da661f3115a309c74f5c75f
Silentsoul04/FTSP_2020
/Mechine Learning Forsk/Income_Data_fields_ML.py
3,144
3.5
4
# -*- coding: utf-8 -*- """ Created on Sat Mar 7 18:02:02 2020 @author: Rajesh """ """ Explain the Income Data fields Divide into features and labels with explanation HR Tool to offer a salary to new candidate of 15 yrs Explain the plotting of two list with range data Explain best fit line concept, Calculate slope a...
a55705a3921e16f5eeaa8bfa1034baabf7bca022
Silentsoul04/FTSP_2020
/CodeBasics_Pandas/Numpy_CB/slicing_stacking_arrays_Numpy.py
3,637
4.0625
4
# -*- coding: utf-8 -*- """ Created on Fri Apr 17 11:23:26 2020 @author: Rajesh """ slicing/stacking arrays, indexing with boolean arrays : - ------------------------------------------------------- import numpy as np n = [6,7,8,9] n[1] # 7 n[-1] # 9 n[1:3] # [7,8] a = np.array([6,7,8,9]) a[0] # 6 a[-2] # 8 a[...
0b8edc36cd1736354e08a6cb5791a150d6f67478
Silentsoul04/FTSP_2020
/Mechine Learning Forsk/Test_Data_ML.py
1,081
3.859375
4
# -*- coding: utf-8 -*- """ Created on Fri Mar 6 07:39:27 2020 @author: Rajesh """ Question :- There are some values have given and pls find the solution for those values by using Linear Regresssion. import pandas as pd import numpy as np import matplotlib.pyplot as plt x = [1,2,3,4,5,6,7,8] y = [1,2,3,4,5,6,7,8]...
8a279d2f585a3cb655252fb5e379a89c6feb0a66
Silentsoul04/FTSP_2020
/W3_2020_School/Python_Try_Except_Finally_Blocks.py
4,091
4.3125
4
# -*- coding: utf-8 -*- """ Created on Sat Apr 25 11:17:16 2020 @author: Rajesh """ ''' Python Try Except Finally :- ----------------------------- ''' NOTE :- There are we have mainly 3 blocks like listed below. 1) try block 2) except block 3) finally block 1) try block :- ---------------- It is used to test the e...
d093fb66538b6974d06cf68b96ae210cef93a738
Silentsoul04/FTSP_2020
/Forsk Pandas/Male_Female_Pie_Details.py
909
3.53125
4
# -*- coding: utf-8 -*- """ Created on Sun Feb 23 17:29:02 2020 @author: Rajesh """ 5. How many are Male Staff and how many are Female Staff. Show both in numbers and Graphically using Pie Chart. Show both numbers and in percentage. import pandas as pd df = pd.read_csv('E:\PYTHON CODE Challenges\Pandas\Sa...
8edd3a0d64fb139017c1d9a1c682c507d462e10d
Silentsoul04/FTSP_2020
/Summer Training ML & DL/Backward_Elimination_Features_Selection_Features_Extraction.py
2,948
3.546875
4
# -*- coding: utf-8 -*- """ Created on Sat Jun 6 15:02:35 2020 @author: Rajesh """ import pandas as pd import numpy as np import matplotlib.pyplot as plt dataset = pd.read_csv('E:\ML Code Challenges\ML CSV Files\Salary_Classification.csv') dataset.head() **************** Department WorkedHours Certification ...
b62b7a448bdf7cd15cb1e32e3a023194703b0c77
Silentsoul04/FTSP_2020
/Knowledge Shelf/set_index_reset_index()_Pandas_9.py
3,614
3.75
4
# -*- coding: utf-8 -*- """ Created on Wed Apr 1 11:01:59 2020 @author: Rajesh """ """ set_index & .reset_index() in Pandas :- ------------------------------------- """ import pandas as pd bond = pd.read_csv('E:\Knowledge Shelf\csv Files\jamesbond.csv') bond.head() # Here IF we want we can change the index of the ...
c6f55ab676a899e115bda4f5316e408f2710f1bd
Silentsoul04/FTSP_2020
/Extra Lockdown Tasks/Operators_Python.py
405
4.15625
4
# Operators in Python :- 1) Arithematic 2) Assignement 3) Comparison 4) Logical 5) Membership 6) Identity 7) Bitwise Ex :- x = 2 y = 3 print(x+y) print(x-y) print(x*y) print(x/y) print(x//y) print(x%y) print(x**y) Ex :- x = 1001 print(x) x+=9 print(x) x-=9 print(x) x*=9 print(x) Ex :- == > < >= , <= ,...
bbd493c80b0bac169c1315a83ecc6dbc8f7fc031
Silentsoul04/FTSP_2020
/Python_CD6/list_dict.py
953
3.859375
4
# -*- coding: utf-8 -*- """ Created on Mon Jan 20 17:04:48 2020 @author: Rajesh """ """ Filename: list_dict.py Problem Statement: Assume you’re given the following list of files: ist_of_files = ['data0001.txt', 'data0002.txt','data0003.txt'] Create a dictionary filenum where the keys are the filename...
75491c0af8bf38a3559541610a49781277015070
Silentsoul04/FTSP_2020
/W3_2020_School/Python_Data Types.py
3,105
4.1875
4
# -*- coding: utf-8 -*- """ Created on Sun Apr 19 10:41:11 2020 @author: Rajesh """ ''' Python Data Types :- Python has some of the Build-in data types. ------------------ ''' In programming, data type is an important concept. Variables can store data of different types, and different types can do different things. ...
233e0324d6c7a092508701f2777771aaa33f3da2
Silentsoul04/FTSP_2020
/NumPy Forsk/NumPy_Basic_Details.py
8,135
4.03125
4
# -*- coding: utf-8 -*- """ Created on Fri Feb 21 15:39:36 2020 @author: Rajesh """ # Numerical Python '''Introduction to NumPy''' my_list = [0,1,2,3,4,5,6,7,8] print (type(my_list)) print (my_list) # Convert your list data to NumPy arrays. import numpy as np arr = np.array(my_list) print(type(arr)) # <class 'nu...
80495410c0f20b979837fefe392820179f28f4ba
Silentsoul04/FTSP_2020
/Durga OOPs/Python_Assertions_OOPs.py
4,839
4.375
4
# -*- coding: utf-8 -*- """ Created on Fri Mar 13 16:12:06 2020 @author: Rajesh """ Python Assertions in Simple Way :- ------------------------------- Assertions :- ---------- Assertions are used / perform in Debuging purposes. What is the Meaning of Debugging ? Debugging means removing buggs from the programs. De...
928511975d3b85c7be7ed6c11c63ce33078cc5a1
Silentsoul04/FTSP_2020
/Python_CD6/reverse.py
874
4.25
4
# -*- coding: utf-8 -*- """ Created on Fri Jan 24 11:41:04 2020 @author: Rajesh """ """ Name: Reverse Function Filename: reverse.py Problem Statement: Define a function reverse() that computes the reversal of a string. Without using Python's inbuilt function Take input from User Sample I...
7d7777a67696251e2ea31bc2f7fd775ddae69546
Silentsoul04/FTSP_2020
/Extra Lockdown Tasks/Pattern_Programming_2.py
519
3.5
4
# How to print this below Pattern in Python :- # Pattern :- 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 n = int(input('Enter n value :')) for i in range(n): # 0,1,2,3,4 print((str(i+1)+' ') * n) s1 = 'Andy' s2 = ' Candy' print(s1+s2) # Pattern :- A A A A B B B B C C C C D D D D n = int(input('Enter n val...
8053520749bfa7e4274beebadc8d6ae1d10a91cc
Silentsoul04/FTSP_2020
/Durga OOPs/ClassMethod_OOps.py
4,951
4.375
4
# -*- coding: utf-8 -*- """ Created on Sun Feb 16 21:44:42 2020 @author: Rajesh """ NOTE :- Inside method body if we are accessing only class level(static variables) data. what is the need of declaring as instance method. s = student() # object creation for class student. s.m1() # Accessing the method m1() by using t...
f76176ac85522e740f6b3079d06c545002813302
Silentsoul04/FTSP_2020
/Mechine Learning Forsk/Basics_Of_Data_Analytics.py
6,663
4.21875
4
# -*- coding: utf-8 -*- """ Created on Wed Mar 4 10:55:15 2020 @author: Rajesh """ Pandas :- panel data set. # How to import pandas into our program. # Pandas is the very powerful libraries in the python. import pandas as pd ps = pd.Series(['a','b','c','d']) print(ps) ******* Result ******* 0 a 1 b 2 c ...
993056dc5240d5162ab5966159049dd91ad52719
Silentsoul04/FTSP_2020
/W3Schools/Day1_09_02_20.py
12,224
3.765625
4
# -*- coding: utf-8 -*- """ Created on Sun Feb 9 13:06:57 2020 @author: Rajesh """ " There are some basic python programs. " print("Hello, world!") # Valid code. print('Hello, world!') # Valid code. print('Hello, world!'); # Valid code. ################# Python Indentation ############################# if ...
3b99dbfee67d5405bdbbf59b6e48b9ba24d924bd
Silentsoul04/FTSP_2020
/Mechine Learning Forsk/Multiple Linear Regression_ML.py
6,967
3.546875
4
# -*- coding: utf-8 -*- """ Created on Tue Mar 17 15:14:09 2020 @author: Rajesh """ """ # Open Salary_Classification.csv # Teach how to read the dataset # Sandeep is working in the Development Department, # have worked for 1000 hours # Has 1 Certificate and have 2 years experience # Now predict the salary for Sande...
229bab0555b7768103b620a08459fb99126689b8
Silentsoul04/FTSP_2020
/W3_2020_School/ML Concepts/Machine_Learning_Mean _Median_Mode.py
3,364
4.28125
4
# -*- coding: utf-8 -*- """ Created on Tue Apr 28 17:32:02 2020 @author: Rajesh """ ''' Machine Learning - Mean Median Mode :- ------------------------------------------ ''' What can we learn from looking at a group of numbers ? In Machine Learning (and in mathematics) there are often three values that interests us:...
953ebb6e03cbac2798978798127e144ac2eee85f
Silentsoul04/FTSP_2020
/Python_CD6/generator.py
930
4.28125
4
# -*- coding: utf-8 -*- """ Created on Tue Jan 28 17:46:18 2020 @author: Rajesh """ """ Name: generator Filename: generator.py Problem Statement: This program accepts a sequence of comma separated numbers from user and generates a list and tuple with those numbers. Data: Not required E...
12430ff52d75dee8bae34b58f3a5164d585c4ec9
Silentsoul04/FTSP_2020
/Durga OOPs/Nested_Classes_OOPs.py
2,534
4.15625
4
# -*- coding: utf-8 -*- """ Created on Sat Mar 14 15:37:38 2020 @author: Rajesh """ Nested Classes :- -------------- class Person: def __init__(self): self.name = 'Forsk Coding School' self.dob = self.DOB() def display(self): print('Name :', self.name) self.dob.display() ...
49942a142abf3432f1fd6c0d651f85c7ebd35894
Silentsoul04/FTSP_2020
/Summer Training ML & DL/Performance_Measurement_8.py
2,892
3.578125
4
# Import the Libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt # To Import csv file dataset = pd.read_csv('E:\ML Code Challenges\ML CSV Files\student_scores.csv') dataset.isnull().any(axis=0) # To seggrating the features & lables from dataset. features = dataset.iloc[:,:-1].values la...
2eb8ad52b31fa0d66b3b94d9c5dc007e5e09e472
Silentsoul04/FTSP_2020
/Ritchie Ng Pandas/Changing_datatype_Pandas.py
2,877
3.609375
4
# Changing data type in Pandas :- import pandas as pd url = 'http://bit.ly/drinksbycountry' df = pd.read_csv(url) df.head() df.columns df.dtypes -------------- country object beer_servings int64 spirit_servings int64 wine_servings ...
bc8e51371dbfeee174a2a9e150a353a46ebb8a38
Silentsoul04/FTSP_2020
/Durga OOPs/Empclass_Obj_ref_variable.py
840
3.515625
4
# -*- coding: utf-8 -*- """ Created on Thu Feb 13 10:21:43 2020 @author: Rajesh """ class Employee: '''doc string(description)''' def __init__(self,eno,ename,esal,eaddr): self.eno = eno self.ename = ename self.esal = esal self.eaddr = eaddr def info(self): ...
325deda4f80c3273ac77a80f9583658c76efbcb3
Silentsoul04/FTSP_2020
/Durga Flow Control/InfiniteLoops_NestedLoops.py
1,461
3.828125
4
# -*- coding: utf-8 -*- """ Created on Fri Jan 24 21:58:06 2020 @author: Rajesh """ ########### Infinite loops ################ i = 1 # while True: while(True): print('Forsk coding school',i) i = i + 1 print('Rajesh sharma') break # It's used to stop the execution of next lines....
ccfcd60b764c69152a7d8843dc02c197798863bf
Silentsoul04/FTSP_2020
/CodeBasics_Pandas/Handle_Group_By_(Split Apply Combine).py
3,242
4
4
# -*- coding: utf-8 -*- """ Created on Sun Apr 12 15:42:16 2020 @author: Rajesh """ 1) Find maximum temperature at each city. 2) Find avarage wind speed for every city. import pandas as pd import numpy as np df = pd.read_csv('E:\CodeBasics_Pandas\Pandas_CSV_CB\weather_by_cities.csv') df.head() ************* ...
7ad064ce2fc4150f351ef3ce360dd3d7230a34f6
Silentsoul04/FTSP_2020
/Python_CD6/weeks.py
2,024
4.28125
4
# -*- coding: utf-8 -*- """ Created on Wed Jan 22 17:01:28 2020 @author: Rajesh """ """ Name: weeks Filename: weeks.py Problem Statement: Write a program that adds missing days to existing tuple of days Sample Input: ('Monday', 'Wednesday', 'Thursday', 'Saturday') Sample Output: ('Monday...
313a93ce8a62c64e9697bfdde61f2b38b4280721
Silentsoul04/FTSP_2020
/DataBase Forsk/db_University.py
1,326
3.8125
4
# -*- coding: utf-8 -*- """ Created on Mon Feb 10 13:31:27 2020 @author: Rajesh """ """ Code Challenge 1 Write a python code to insert records to a sqlite named db_University for 10 students with fields like Student_Name, Student_Age, Student_Roll_no, Student_Branch. """ import sqlite3 from pandas import DataFrame ...
ce643b9df8113ce2ea53623aecf9d548398eea7e
Silentsoul04/FTSP_2020
/Durga Strings Pgms/Words_Str_Reverse.py
299
4.21875
4
# WAP to print the words from string in reverse order and take the input from string. # s='Learning Python is very easy' s=input('Enter some string to reverse :') l=s.split() print(l) l1=l[: :-1] # The Output will be in the form of List. print(l1) output=' '.join(l1) s.count(l1) print(output)
4afacd3477d602c6019875ebeb4451b2d2ae4446
Silentsoul04/FTSP_2020
/Mechine Learning Forsk/Without_Random_State_ML.py
3,006
3.96875
4
# -*- coding: utf-8 -*- """ Created on Sat Mar 7 21:52:26 2020 @author: Rajesh """ # Now explain the random state by pring features_test with and without random state set. import numpy as np X,y = np.arange(10).reshape(5,2),list(range(5)) print(type(X)) # <class 'numpy.ndarray'> print(type(y)) # <class 'list'> p...
76c8230dd98a70bb2c742a6efcdcbf5a4d842940
Silentsoul04/FTSP_2020
/Mechine Learning Forsk/Student_Details_ML1.py
1,237
3.78125
4
# -*- coding: utf-8 -*- """ Created on Fri Mar 6 16:27:43 2020 @author: Rajesh """ # Now if I want to get 100 Scores.(features=which is given in the question) # How much hours do i need to study.(Labels=which we need to find out ?) # Reverse the features and labels and try the model and prediction again # You might ...
38587606ca1f9e5f6e553e319b41b633feddd966
Silentsoul04/FTSP_2020
/CodeBasics_Pandas/Handle_Missing_Data_replace()_function.py
3,832
3.609375
4
# -*- coding: utf-8 -*- """ Created on Sun Apr 12 13:21:35 2020 @author: Rajesh """ import pandas as pd import numpy as np dataset = pd.read_csv('E:\CodeBasics_Pandas\Pandas_CSV_CB\weather_data.csv') dataset.head() **************** day temperature windspeed event 0 1/1/2017 32 6 Rain 1...
899db6e84ffad7514dbac57c7da77d04d78acb70
Silentsoul04/FTSP_2020
/Python_CD6/pangram.py
1,480
4.3125
4
# -*- coding: utf-8 -*- """ Created on Mon Jan 27 17:37:41 2020 @author: Rajesh """ """ Name: Pangram Filename: pangram.py Problem Statement: Write a Python function to check whether a string is PANGRAM or not Take input from User and give the output as PANGRAM or NOT PANGRAM. Hint: Pan...
a494f9441b74e00203c782305b3f10324785260d
Silentsoul04/FTSP_2020
/Ritchie Ng Pandas/Using_String_Methods_Pandas.py
3,816
4.4375
4
# Using String Methods in Pandas :- # convert string to uppercase in Python s1 = 'hello'.upper() print(s1) # 'HELLO' Q.1. How about string methods in pandas? Answer :- There are many! import pandas as pd url = 'http://bit.ly/chiporders' df = pd.read_csv(url , delimiter = '\t') df.head() df.columns ----------...
8ee60a4dcca73c9d5ffa1ca30acc3132ccd6af7c
Silentsoul04/FTSP_2020
/CodeBasics_Pandas/Matplotlib_CB/Axes_labels_Legend_Grid_Matplotlib.py
974
3.828125
4
# -*- coding: utf-8 -*- """ Created on Fri Apr 17 15:25:58 2020 @author: Rajesh """ ''' Axes labels, Legend, Grid :- --------------------------- ''' import matplotlib.pyplot as plt days = [1,2,3,4,5,6,7] max_t = [45,56,50,35,47,35,40] min_t = [25,30,40,42,48,50,52] avg_t = [10,25,15,22,31,45,44] plt.plot(days,ma...
efa52f8382abeeadecad3fd2e63983fcda0800ce
Silentsoul04/FTSP_2020
/Durga OOPs/Python_Variables.py
5,003
4.3125
4
# -*- coding: utf-8 -*- """ Created on Thu Feb 13 22:28:43 2020 @author: Rajesh """ Inside Python class 3 types of variables :- ---------------------------------------- 1) Instance variables / Object level variables. Ex :- class student: def __init__(self,name,rollno): print('Constructor will be execute...
4056e210dfddbe7b6b416e80b816f4d1754328a6
Silentsoul04/FTSP_2020
/Mechine Learning Forsk/Language_Growth_Year.py
1,199
3.640625
4
# -*- coding: utf-8 -*- """ Created on Fri Mar 6 10:41:02 2020 @author: Rajesh """ import pandas as pd import numpy as np import matplotlib.pyplot as plt dataset = pd.read_csv('E:\ML Code Challenges\ML CSV Files\Lanuages_growth_Year.csv') print(dataset) features = dataset.iloc[:, :1].values # It ontains rows & Col...
5538f10eb0dacb1ef813af17e263058bbda4a950
Silentsoul04/FTSP_2020
/Knowledge Shelf/KS_Machine_Learning_2020/Homeprices.csv_SLR.py
2,443
3.828125
4
# -*- coding: utf-8 -*- """ Created on Wed Apr 8 17:32:49 2020 @author: Rajesh """ import pandas as pd import numpy as np import matplotlib.pyplot as plt dataset = pd.read_csv('E:\Knowledge Shelf\KS_Machine_Learning_2020\ML_CSV\homeprices.csv') dataset.head() ********* area price 0 2600 550000 1 3000 565000...
83597aff81e13fd2b6aa4f510e64b208ef058d10
Silentsoul04/FTSP_2020
/Knowledge Shelf/Rank()_Method_Pandas_6.py
6,870
3.84375
4
# -*- coding: utf-8 -*- """ Created on Mon Mar 30 12:56:35 2020 @author: Rajesh """ """ Rank Method in Pandas :- --------------------- """ import pandas as pd nba = pd.read_csv(r'E:\Knowledge Shelf\csv Files\nba.csv') # To check the Nan into the dataset we can check like this. # It shows the all Nan values into dat...
54205a92ca861e9bdd76fdac6fa291e3dafa3efb
Silentsoul04/FTSP_2020
/Knowledge Shelf/Pandas_1.py
4,204
3.703125
4
# -*- coding: utf-8 -*- """ Created on Fri Mar 27 22:46:52 2020 @author: Rajesh """ import pandas as pd dataset = pd.read_csv('E:/Knowledge Shelf/csv Files/Salary_Classification.csv' , squeeze = True) print(dataset) dataset.head() ********************* Department WorkedHours Certification YearsExperience Sala...
891bcde12d8917ffac1788ed28133d8eece93122
Jan428/NYU-Introduction-To-Python-Jeffrey-An
/umbrella.py
155
4.28125
4
rain = input("Is it raining? Yes or No? \n") if rain == 'yes' or 'Yes': print('You need an umbrella!') else: print('You do not need an umbrella')
4c0f5aae4f560c37d452179d2aae905659729d96
rmeji1/Python
/Homework - Animals/Animals.py
1,417
4.0625
4
class Animal: """A simple animal class""" def __init__(self,name): elephant=("I have exceptional memory", "I am the largest land-living mammal in the world", "I can swim and use my trunk to brathe like a snorkel."); tiger=("I am the biggest cat", ...
f64663726ed78fc680fbae42072d81360c319cb1
Sandibintara/Pertemuan6
/lab1.1.py
445
3.546875
4
# lab 1 ( Penggunaan {end=}) print('A', end='') print('B', end='') print('C', end='') print() print('x') print('Y') print('Z') # Sparator / Penghubung sep= # Deklarasi variabel beserta nilainya w, x, y, z = 10, 15, 20, 25 # Menampilkan tiap hasil variable print(w, x, y, z) # Penulisan pengunaan sparator print(w, x, ...
51f6c00289ce747ec14d8a0e6886eed7f45d0e36
Luckercorgi240/python_codes
/Chapter13/paddleball.py
4,647
3.875
4
from tkinter import * import random import time def RepresentsInt(s): try: int(s) return True except ValueError: return False speed = input('How fast do you want the ball to be? (between 1 and 5)') while RepresentsInt(speed) != True or int(speed) < 0 or int(speed) > 5: print('Your ...
9bd958f1f64ad989b42902812520681e66ee4140
Luckercorgi240/python_codes
/Python drawing/mysquare.py
649
4.09375
4
import turtle t = turtle.Pen() def mysquare(size, filled, color): t.fillcolor(color) if filled == True: t.begin_fill() for x in range(1, 5): t.forward(size) t.left(90) if filled == True: t.end_fill() turtle.done() print('How big do you want the square to be?') size = ...
271d19d9e2b49eb1eae1cb2dba6f4ff010793e29
madnoh/Work-in-Progress
/Tai Sai Simulator/Tai Sai simulator.py
1,460
3.90625
4
# Tai Sai simulator '''from itertools import combinations_with_replacement threeDice = combinations_with_replacement(range(1, 7), 3) #print(list(threeDice)) print(type(threeDice))''' # Small is between 4 to 10, except triples Pay 1:1 # Big is between 11 to 17, except triples Pay 1:1 # Triples pay 1:30 # S...
292293054f619d32f783c329280d8eaef9b96515
DestructHub/ProjectEuler
/Problem058/Python/solution_1.py
1,134
3.765625
4
import math def is_prime(n): if n%2 == 0: return False for i in range(3, math.floor(math.sqrt(n)) + 1, 2): if n%i == 0: return False return True class Problem058(object): def __init__(self): self.nprimes = 8 self.level = 7 self.prime_ratio = 0.62 ...
bf04c58cb7481b0b85f5c2c3a601c912cd18e76b
DestructHub/ProjectEuler
/Problem473/Python/solution_slow_2.py
2,058
3.796875
4
# -*- coding: utf-8 -*- #problem 473 """ Let φ be the golden ratio: φ=1+5√2. Remarkably it is possible to write every positive integer as a sum of powers of φ even if we require that every power of φ is used at most once in this sum. Even then this representation is not unique. We can make it unique by requiring that n...
f79711022bc93da97ccfa84e5b9b2601792564df
DestructHub/ProjectEuler
/Problem040/Python/solution_1.py
821
3.625
4
#!/usr/bin/env python # coding=utf-8 # Python Script # # Copyleft © Manoel Vilela # # from functools import reduce from itertools import count def frac_series_generator(): '''each n after 0.1 from 0.12345678910111213...''' for w in count(start=1, step=1): for s in str(w): yield s de...
27d0dc5f8356439abdd0e5cc8af0d15560e99f0d
DestructHub/ProjectEuler
/Problem018/Python/solution_1.py
1,052
3.53125
4
#search the biggest sum nums adjacent on the row of the triangle below #python3.4 triangle = '''\ 75 95 64 17 47 82 18 35 87 10 20 04 82 47 65 19 01 23 75 03 34 88 02 77 73 07 63 67 99 65 04 28 06 16 70 92 41 41 26 56 83 40 80 70 33 41 48 72 33 47 32 37 16 94 29 53 71 44 65 25 43 91 52 97 51 14 70 11 33 28 77 73 17 78 ...
60da672cad8c329e17433f34116812baa1435a80
DestructHub/ProjectEuler
/Problem012/Python/solution_2.py
1,137
3.765625
4
# Good Solution found on forum thread in the projecteuler from functools import reduce def divisors(x): ''' exponents(28) --> 6 because 28 = 2**2 * 7*1: total number of divisors of 28: (2+1)*(1+1) = 6 ''' expList = [] count = 0 divisor = 2 while divisor <= x: while x % divisor...
d9e68f34571c9c628ae3b776e77958c94a601db5
DestructHub/ProjectEuler
/Problem080/Python/solution_1.py
594
3.609375
4
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright © Manoel Vilela 2017 # # @team: DestructHub # @project: ProjectEuler # @author: Manoel Vilela # @email: manoel_vilela@engineer.com # import decimal import math def solution(limit): decimal.getcontext().prec = 102 # more than 100 t...
ddaf9f636b0b9bba95c74a83c1ae0cbc636bb7fa
DestructHub/ProjectEuler
/Problem026/Python/solution_1.py
2,170
4.09375
4
#!/usr/bin/env python # coding=utf-8 # Python Script # # Copyleft © Manoel Vilela # # # A unit fraction contains 1 in the numerator. # The decimal representation of the unit fractions # with denominators 2 to 10 are given: # 1/2 = 0.5 # 1/3 = 0.(3) # 1/4 = 0.25 # 1/5 = 0.2 # 1/6 ...
2672577bfdb548ec015a64122742d90f5cdb901a
xzj963179571/python_demo
/python_demo/python_demo_05.py
2,401
4.03125
4
# coding = UTF-8 # 字符串的使用 |字符串是 Python 中最常用的数据类型。我们可以使用引号( ' 或 " )来创建字符串。 # var1 = 'Hello World!' # var2 = "Alex" # Python 访问子字符串,可以使用方括号来截取字符串 # print ("var1[0]: ", var1[0]) # print ("var2[1:4]: ", var2[1:4]) # Python 字符串更新 # var1 = 'Hello World!' # print ("已更新字符串 : ", var1[:6] + 'Runoob!') # 列表 # 序列是Python中最基本...
a0abd3a16d2daa13fc8b8676cd5ff785aeb5386f
baralganesh/Python-SimpleMaths
/sum_of_odd_even_negative_numbers.py
462
3.984375
4
nums = int(input("Enter how many numbers you want to calculate: ")) user_numbers =[] for c1 in range (nums): no = int(input("Enter numbers: ")) user_numbers.append(no) sum1 = 0 sum2 = 0 sum3 = 0 for nos in user_numbers: if nos >1: if nos%2 ==0: sum1 += nos else: sum...
cd37d581b392dcf3768206c4d7f045fab686d590
mpss2019fn1/filemerge
/file_merge.py
1,093
3.546875
4
import os import sys import argparse from validate_directory import ValidateDirectory def main(): parser = _create_arg_parser() args = parser.parse_args() output = args.output if output: output = open(output, "w") else: output = sys.stdout for filename in os.listdir(args.sou...
54ed0799fe9f25cb775bcdbab10bab905414cfd2
ANU197/CodeChef-Contest1
/Chewing.py
1,960
3.640625
4
""" Zonal Computing Olympiad 2013, 10 Nov 2012 Hobbes has challenged Calvin to display his chewing skills and chew two different types of Chewing Magazine's Diabolic Jawlockers chewing gum at the same time. Being a generous sort of tiger, Hobbes allows Calvin to pick the two types of gum he will chew. Each type of c...
b517ce0c1dbeb92b861ef793437df017d1cae695
astamicu/Whist-Scorer
/old_versions/whistv0.4.py
10,571
3.796875
4
##players = [] ##def howManyPlayers(): ## while True: ## try: ## no_players = int(input('Enter number of players(3-6): ')) ## except ValueError: ## print('Enter a number between 3 and 6): ') ## continue ## if no_players not in range(3, 7): ## print('BE...
dd686a279acc19bd6a62276b52ec7e96a4d8cf1b
jangseokgyu/python-algorithm
/Recursive_hanoi.py
231
3.890625
4
def TowerofHanoi(n,a,b,c): if(n==1) : print(str(a)+" "+str(b)) return TowerofHanoi(n-1,a,c,b) print(str(a)+" "+str(b)) TowerofHanoi(n-1,c,b,a) n = int(input("넣어라")) a=1 b=2 c=3; TowerofHanoi(n, a, b, c)
5d6daf2f364ee0c9e1d38effcee91273e51a7523
MichaelWalker-git/Ud_Ai_Course
/Scales_and_Transformations_Practice.py
1,981
3.84375
4
# coding: utf-8 # In[1]: # prerequisite package imports import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sb get_ipython().run_line_magic('matplotlib', 'inline') from solutions_univ import scales_solution_1, scales_solution_2 # Once again, we make use of the Pokémon data f...
91c4d0a08b923202a02d9c9c30c400e0daf59f29
MichaelWalker-git/Ud_Ai_Course
/Scatterplot_Practice.py
1,992
3.859375
4
# coding: utf-8 # In[2]: # prerequisite package imports import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sb get_ipython().run_line_magic('matplotlib', 'inline') from solutions_biv import scatterplot_solution_1, scatterplot_solution_2 # In this workspace, you'll make use o...
752a06f025ba33f428a353466df9323f1a5d96b1
jprinaldi/algo1
/pa3/karger.py
4,340
3.515625
4
#!/usr/bin/env python3 """ Implementation of Karger's algorithm for computing a minimum cut of a connected graph. """ import argparse import copy class Vertex: def __init__(self, value): self.value = value self.parent = self def __eq__(self, that): return self.get_rep().value == that....
f35d17401b20f52dd943239a2c40cb251fa53d03
jimkaj/PracticePython
/PP_6.py
342
4.28125
4
#Practice Python Ex 6 # Get string and test if palindrome word = input("Enter text to test for palindrome-ness: ") start = 0 end = len(word) - 1 while end > start: if word[start] != word[end]: print("That's not a palindrome!") quit() start = start + 1 end = end -1 print(word,"...
668b160fffc014a4ef3996338f118fc9d4f1db6a
jimkaj/PracticePython
/PP_9.py
782
4.21875
4
# Practice Python #9 # Generate random number from 1-9, have use guess number import random num = random.randrange(1,10,1) print('I have selected a number between 1 and 9') print("Type 'exit' to stop playing") count = 0 while True: guess = input("What number have I selected? ") if guess == 'exit': ...
b6bab19e22bf9813730482141391876a7fb71a05
andreandrade13/URI_Python3
/1143.py
83
3.65625
4
n = int(input()) for i in range(1, n + 1): print("%d %d %d" %(i, i**0, i**3))
5c790768bb5f5889453459f0b9eee19b6640141c
andreandrade13/URI_Python3
/1131.py
542
3.578125
4
resp = 1 soma = 0 somaE = 0 somaI = 0 somaG = 0 while resp == 1: a,b = map(int,input().split()) soma +=1 if(a > b): somaI += 1 elif(b > a): somaG += 1 elif(a == b): somaE += 1 resp = int(input('Novo grenal (1-sim 2-nao)')) print("%d grenais" %soma) print("Inter: %d"...
4c2b3e93037fbdc5a0c750f3cd106a1dac584ca8
sunweiwei45/twitter
/test.py
3,263
3.5
4
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2016/11/25 19:12 # @Author : Sww # @Site : # @File : test.py # @Software: PyCharm Community Edition import csv import pandas def stitching_columns(row): """ 将pandas中的两列简单拼接,such as:column1=[a,c,3], column2=[3,2,d], res = [a3,c2,3d] :param ...
029378b419f547f54a38cd8f203816b05e50dec8
thecrossed/chess_square
/chess_square.py
4,429
3.625
4
# coding: utf-8 # https://www.kaggle.com/datasnaek/chess import numpy as np import pandas as pd # pandas import csv import re import matplotlib import matplotlib.pyplot as plt # Steps # 1 extract moves from each game # 2 turn move string into a new column # 3 extract occupied squares from moves in each game # 4 ...
6f96eb05253b016cf9ec61f688f4c996dd964191
marielle1022/mass_charities_project
/language.py
9,835
3.734375
4
""" language.py file contains functions used to create and update languages. """ import re import organization import validity_check import lang_serv import textwrap # Constant: regex pattern for language names (allows uppercase, lowercase, spaces, and hyphens) lang_pattern = re.compile("[a-zA-Z\\s\\-]*") # Constant...
2f9421d2d6cd6411864b2ef503d7ff8e27ea9e94
kbjung/Likelion
/온라인 교육 파이썬 파일 모음/01. 일단 만드는 Python/01-01-13. 오늘 뭐 드실2.py
228
3.875
4
lunch = ["된장찌개","피자","짜장면","치킨"] while True: print(lunch) item = input("추가할 메뉴를 입력하세요 : ") if item == "q": break else: lunch.append(item) print(lunch)
81e9c881e3ab79f780401b8e0172dcc94005941d
kbjung/Likelion
/01. 일단 만드는 Python/2. Python으로 만드는 익명 질문 게시판(2021.08.23)/질문과 답변(딕셔너리)(내 코드).py
436
3.859375
4
#질문 입력 #답변 입력 #딕셔너리 출력 total_dictionary = {} while True: question = input("질문을 입력해주세요('q'를 입력하면 종료) : ") if question == "q": break else: total_dictionary[question] = "" for i in total_dictionary: print(i) answer = input("답변을 입력하세요('q'를 입력하면 종료) : ") total_dictionary[i] = answe...
5c95c07ab8aec96fd8dd1b487b01abb90aa72320
kbjung/Likelion
/02. [기초] 같이 푸는 PYTHON/03. 조건 - 상황에 따라 다르게/05. 학번 계산기 5 - 동기에게 인사하기/02-03-05. 학번 계산기 5 - 동기에게 인사하기.py
213
3.96875
4
myGrade = int(input("학번을 입력하세요 : ")) yourGrade = int(input("학번을 입력하세요 : ")) if myGrade == yourGrade : print("앗 동기네요!") else : print("앗 동기가 아니네요!")
ff6c4fd245f10f9b99b2e04530109830c80882cd
thefulltimereader/mint
/src/winner.py
7,647
3.640625
4
''' Created on Sep 25, 2010 Assignment 1: Mint Problem: Given: Multiple of 5 cents (any 5c multiple) price is N times more likely than a non-multiple of 5cents. Design a set of 5 coin denominations for US $ s.t.: 1. The number of coins required for 'Exact Change" is minimized 2. Another set of 5 coin de...
b0ec44a2f01ffcda91228ad9b539f1d578117b2a
tdraebing/Data_Analyst_Nanodegree-Project3
/src/Project/createdb.py
480
3.53125
4
############################################################### #Script to load data from a JSON file into a MongoDB database.# ############################################################### import json #function that facilitates the insertion of the data stored in a JSON file into the database def insert_data(d...
988467eeb77c89122a0a7d6ed42b3f192eda8fed
deadsummer/project
/попытки/window.py
382
3.640625
4
from tkinter import * from tkinter.filedialog import * import fileinput def _open(): op = askopenfilename() for l in fileinput.input(op): txt.insert(END,l) root = Tk() m = Menu(root) root.config(menu=m) fm = Menu(m) m.add_cascade(label="File",menu=fm) fm.add_command(label="Open...",command=_open) txt = Text(ro...
ddbc8bd50ff4975e6007358dc5ae97d8e09dcd39
MOUDDENEHamza/JustGetTen
/possibles.py
1,356
3.921875
4
""" n parameter can be found from the board """ ''' the funtion tests if the cells have an adjacents cells of same values ''' def has_adjacent_tile(board, x, y): adjacent = False n = len(board) value = board[x][y] xUp, xDown = x - 1, x + 1 yLeft, yRight = y - 1, y + 1 if xUp < 0: xUp...
b1dff1aea71ec7ebfec48db1ec029a2a7dd349d2
artneuronmusic/Exercise2_SoftwareTesting
/app.py
1,673
4.15625
4
from blog import Blog blogs = dict() MENU_PROMPT = "Enter 'c' to create a blog, 'l' to list blog, 'r' to read one, 'p' to create a post, 'q' to quit" POST_TEMPLATE = '''---{}---{}''' def menu(): print_blogs() selection = input(MENU_PROMPT) while selection != 'q': if selection == 'c': c...
dc7e951d4e963a584889ee005ac10ccb0aa747a1
teejas/PythonProjects
/ex5.py
606
3.734375
4
my_name = 'Tejas A. Siripurapu' my_age = 18 # years my_height = 73 # inches my_weight = 143 # pounds my_eyes = 'brown' my_teeth = 'white' my_hair = 'black' # Let's put these variables to use print "Let's talk about %r." % my_name print "He's %r inches tall" % my_height print "He weighs %r pounds" % my_weight print "Tha...
3ae2bb1a9966ca89dad7c95282becb9871388efb
danidbarrio/App_Gestion_Instituto_FINAL
/codigo_fuente/database.py
30,819
3.796875
4
import sqlite3 from tkinter import messagebox # Clase de la base de datos class DataBase: def __init__(self): # Creación y conexión a la base de datos self.con = sqlite3.connect('prestamos.db') # Cursor para recorrer la base de datos self.cur = self.con.cursor() ...
f03bfa2da2b2c63e6b574a16c17b694a4b8a6424
diogo-as/codes
/randomize.py
700
3.84375
4
import random, collections items = ['here', 'are', 'some', 'strings', 'of', 'which', 'we', 'will', 'select', 'one'] rand_item = items[random.randrange(len(items))] #print(rand_item) participantes = { 'diogo':'', 'nanda':'', 'alice':'', 'tico':'', 'lorena':'', 'kleyton':'', 'pedr...
9749245820a806a3da1f256446398a3558cabc6a
darthlyvading/fibonacci
/fibonacci.py
369
4.25
4
terms = int(input("enter the number of terms ")) n1 = 0 n2 = 1 count = 0 if terms <= 0: print("terms should be > 0") elif terms == 1: print("Fibonacci series of ",terms," is :") print(n1) else: print("Fibonacci series is :") while count < terms: print(n1) total = n1 + n2 ...