Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Korrelationsmatrisen | |
corr = df_cancer.corr() | |
def correlation_columns (correlation_matrix, threshold): | |
all_cols = correlation_matrix.columns | |
cols = [all_cols[correlation_matrix[column]>threshold] for column in correlation_matrix] | |
cols = [col.tolist() for col in cols] | |
result = [(all_cols[index], col) for index, col in enumerate(cols)] | |
return result |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
import requests | |
#Skapa picklad fil från np.array (db_contents) | |
with open('pick.npy', 'wb') as pickle_file: | |
pickle.dump(db_contents, pickle_file) | |
#Läsa in filen lokalt. | |
with open('pick.npy', 'rb') as pickle_file: | |
groda = pickle.load(pickle_file) #groda blir snällt en np.array igen. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pattern = re.compile('(?<=\s\S)\s(?!\S\S)', re.S) | |
re.sub(pattern, '', text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
raw_ext = '.NEF' | |
jpg_ext = '.JPG' | |
destination = 'raws' | |
for filename in os.listdir('.'): | |
(shortname, extension) = os.path.splitext(filename) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conn = sqlite3.connect('../livs.db') # Create db and establish connection | |
conn.row_factory = sqlite3.Row | |
curs = conn.cursor() | |
result = [] | |
rows = curs.execute('select * from livs limit 4000') | |
for row in rows: | |
result.append(row) | |
db_contents = np.array(result) | |
print (db_contents) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder