python-3.x

How can we show ONLY features that are correlated over a certain threshold in a heatmap?

做~自己de王妃 提交于 2021-02-08 11:47:23
问题 I've got too many features in a data frame. I'm trying to plot ONLY the features which are correlated over a certain threshold, let's say over 80%, and show those in a heatmap. I put some code together, and it runs, but I still see some white lines, which have no data, and thus no correlation. Also, I'm seeing things that are well under 80% correlation. Here is the code that I tried. import seaborn c = newdf.corr() plt.figure(figsize=(10,10)) seaborn.heatmap(c, cmap='RdYlGn_r', mask = (np.abs

Deleting hidden directories? [duplicate]

做~自己de王妃 提交于 2021-02-08 11:39:42
问题 This question already has answers here : How to search for a folder name in python and delete it (2 answers) Closed 1 year ago . I have a directory where there can be .unwanted directories anywhere within the directory tree. I want these deleted. import shutil shutil.rmtree('.unwanted', onerror=True) This does not work because the directories are hidden. Output: Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 374, in

Openpyxl 'str' object cannot be interpreted as an integer

被刻印的时光 ゝ 提交于 2021-02-08 11:39:42
问题 I am trying to run a simple piece of code (Python 3.6) to convert a range of cells in excel worksheet into a list. Here is the code: import openpyxl wb_d = openpyxl.load_workbook('example.xlsx') ws = wb_d.active # iterate through all rows in specific column openpyxl mylist = [] for row in ws.iter_rows('A{}:A{}'.format(ws.min_row,ws.max_row)): for cell in row: mylist.append(cell.value) print(mylist) I am receiving an error: Traceback (most recent call last): File "PycharmProjects/Excel/list

Converting a Certificate Revocation List (CRL) file from .crl to .pem extension - Python 3

折月煮酒 提交于 2021-02-08 11:38:45
问题 I am developing a Python 3.4 application component which checks if a URL's certificate exists in the CRL provided by its CA. I am using a cryptography package to load a certificate as well as the CRL. Below is the section of the code; from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.x509.oid import ExtensionOID from cryptography.x509.oid import NameOID import urllib.request URL = "www.xxx.com" cert_str = ssl.get_server_certificate((URL

Py2app app not launching just asks if I want to terminate the app or open console

…衆ロ難τιáo~ 提交于 2021-02-08 11:38:41
问题 So I am working on a little project of mine that I want to distribute easily so naturally, I use py2app to make a single .app file that will execute on any Mac computer. I tried this tutorial: https://www.metachris.com/2015/11/create-standalone-mac-os-x-applications-with-python-and-py2app/. The problem is that even if I try the example that he gives in the tutorial it crashes and shows this window: Crash image if I look in the console log of the event I see these tow errors. error 17:12:44

python and kivy input text in first windows after click button print ( text ) as label ( update label ) in second widows

十年热恋 提交于 2021-02-08 11:37:49
问题 I want create simple app and I'm new in python, this app contain two windows , at first windows have one button (Save) and two input text. at the second windows we have four label. after click on button in first windows the label ( username 1 print here ) in second windows change according text input in first windows.enter image description here enter image description here when I run my code the label not change, any one can help me what is wrong. python code from kivy.app import App from

Converting a Certificate Revocation List (CRL) file from .crl to .pem extension - Python 3

て烟熏妆下的殇ゞ 提交于 2021-02-08 11:37:00
问题 I am developing a Python 3.4 application component which checks if a URL's certificate exists in the CRL provided by its CA. I am using a cryptography package to load a certificate as well as the CRL. Below is the section of the code; from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.x509.oid import ExtensionOID from cryptography.x509.oid import NameOID import urllib.request URL = "www.xxx.com" cert_str = ssl.get_server_certificate((URL

matplotlib onclick event repeating

岁酱吖の 提交于 2021-02-08 11:29:19
问题 I want to use the onclick method to select a range of data on my matplotlib graph. But the thing is, I can't do that more than once and update the plot. I have some ideas to do this, one of them would be to make a list of plots where I jump to new indices after I appended the new picture ... but mostly I would like to be able to store the information from the click ( event.xdata ) two times to color the area under the graph in that section - but for starters it would already be an achievement

matplotlib onclick event repeating

丶灬走出姿态 提交于 2021-02-08 11:28:25
问题 I want to use the onclick method to select a range of data on my matplotlib graph. But the thing is, I can't do that more than once and update the plot. I have some ideas to do this, one of them would be to make a list of plots where I jump to new indices after I appended the new picture ... but mostly I would like to be able to store the information from the click ( event.xdata ) two times to color the area under the graph in that section - but for starters it would already be an achievement

Python: remove duplicate items from a list while iterating

眉间皱痕 提交于 2021-02-08 11:21:51
问题 I have a list named results, I want to get rid of the duplicate items in the list, the expected result and my results does not match, I checked my code but cannot find what is the problem, what happened? Thanks a lot! results = [[-4, -2, 6], [-4, -2, 6], [-4, -2, 6], [-4, -2, 6], [-4, -2, 6], [-4, -2, 6], [-4, 0, 4], [-4, 0, 4], [-4, 1, 3], [-4, 1, 3], [-4, 2, 2], [-4, 2, 2], [-4, 2, 2], [-2, -2, 4], [-2, -2, 4], [-2, -2, 4], [-2, -2, 4], [-2, 0, 2], [-2, 0, 2], [-2, 0, 2], [-2, -2, 4], [-2,