Skip to content

Instantly share code, notes, and snippets.

number = int(input('Insert number. The program will return list of all prime numbers to the inserted number: '))
print('You inserted the number %i' % number)
listofprimenumbers = []
for i in range (0, number):
raisingnumber = 1
listofnumbers = []
for i in range (0, number):
if number % raisingnumber == 0:
listofnumbers.append(raisingnumber)
raisingnumber = raisingnumber + 1
#total working years
plt.figure(figsize = (8, 4))
N = 8
att_yes = (33, 17, 12, 11, 8, 5, 8, 13)
att_no = (67, 83, 88, 89, 92, 95, 92, 88)
ind = np.arange(N) # the x locations for the groups
width = 0.35 # the width of the bars: can also be len(x) sequence
p1 = plt.bar(ind, att_yes, width, color='#ab1f43')
p2 = plt.bar(ind, att_no, width, color='#1f43ab',
@MonikaPdb
MonikaPdb / data.md
Last active December 10, 2017 14:26
department
employee_number age attrition attrition_num business_travel business_travel_num monhtly_income
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
header = ['monthly income','job role','marital status','overtime','stock option level', 'age']
dataset = [(100, 0, 80, 85, 86.7, 100),(0, 3.3, 16.7, 15, 10, 0), (0, 31.7, 3.3, 0, 0, 0), (0, 0, 0, 0, 3.3, 0), (0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0), (0, 20, 0, 0, 0, 0),(0, 15, 0, 0, 0, 0), (0, 30, 0, 0, 0, 0) ]
fig = matplotlib.pyplot.gcf()
fig.set_size_inches(18.5, 10.5)
configs = dataset[0]
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
header = ['monthly income','job role','marital status','overtime', 'stock option level', 'age']
dataset = [(100, 8.9, 32.0, 28.3, 42.9, 100),(0, 3.5,45.8,71.7,40.5,0), (0,17.6,22.2,0,10.7,0), (0,6.9,0,0,5.8,0), (0,9.9,0,0,0,0), (0,5.4,0,0,0,0), (0,19.9,0,0,0,0), (0,22.2,0,0,0,0), (0,5.6,0,0,0,0)]
fig = matplotlib.pyplot.gcf()
fig.set_size_inches(18.5, 10.5)
configs = dataset[0]
# Non-proportional venn diagram for all correctly assigned
from matplotlib import pyplot as plt
import numpy as np
from matplotlib_venn import venn3, venn3_circles, venn3_unweighted
plt.figure(figsize=(10, 10))
vd = venn3_unweighted(subsets=(61, 37, 39, 6, 41, 31, 1158))
for text in vd.subset_labels:
text.set_weight('bold')
for text in vd.subset_labels:
text.set_color('black')
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import accuracy_score
import plotly.offline as py
py.init_notebook_mode(connected=True)
from sklearn.ensemble import RandomForestClassifier
# Data import
attrition = pd.read_csv('C:/Users/monik/Desktop/DA/final_project/excel_txt/vstupy/att_csv.csv')
# Correlation with seaborn with better axis labels
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
attrition_num = pd.read_csv('C:/Users/monik/Desktop/DA/final_project/excel_txt/vstupy/att_num_csv.csv')
attrition_num.head()
labels = ['employee number', 'age',
'business travel', 'monhtly income', 'department', 'distance from home',
'education', 'education field', 'environment satisfation', 'gender',
'job involvement', 'job level', 'job role', 'job satisfaction',