Sign Up

Sign In

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask question.

Share & grow the world's knowledge!

We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.

What's your question?
  1. On colab using a Python 3 kernel, you should be all set with running in one cell (takes a while, but gives you visual feedback about progress, differently from spacy.cli) !python -m spacy download en_core_web_lg Then, restart the colab runtime! (to do this in the colab menu, go for Runtime > RestRead more

    • 0
  2. On colab using a Python 3 kernel, you should be all set with running in one cell (takes a while, but gives you visual feedback about progress, differently from spacy.cli) !python -m spacy download en_core_web_lg Then, restart the colab runtime! (to do this in the colab menu, go for Runtime > RestRead more

    • 0
  3. @HarisKhaliq, I will answer this question because it will benefit other people. The error message means that the dataframe contains blank entries that default to na/NaN. You can just add na=False in the synatx to fill value for missing values. import csv import os import pandas as pd os.chdir('C:\\URead more

    • 0
  4. If you want to ignore it, add the following to your code at the top: import warnings warnings.filterwarnings("ignore", category=FutureWarning) Else specify solver as so: LogisticRegression(solver='lbfgs') Source: solver : str, {‘newton-cg’, ‘lbfgs’, ‘liblinear’, ‘sag’, ‘saga’}, default: ‘liblinear’.Read more

    • 0
  5. Here's how to do it properly in CBC mode, including PKCS#7 padding: import base64 from Crypto.Cipher import AES from Crypto.Hash import SHA256 from Crypto import Random def encrypt(key, source, encode=True): key = SHA256.new(key).digest() # use SHA-256 over our key to get a proper-sized AES key IV =Read more

    • 0
  6. You're on the right track. if exporterslist: #if empty_list will evaluate as false. importer = exporterslist.pop(0) else: #Get next entry? Do something else?

    • 0
  7. Try this: import openpyxl wb = load_workbook(filename='xxxx.xlsx') ws = wb.worksheets[0] ws['A1'] = 1 ws.cell(row=2, column=2).value = 2 ws.cell(coordinate="C3").value = 3 # 'coordinate=' is optional here This will set Cells A1, B2 and C3 to 1, 2 and 3 respectively (three different ways of setting cRead more

    • 0
  8. If you want to apply it to all columns, do df[df > 0] with dropna(): >>> df[df > 0].dropna() a b 0 21 1 3 3 17 If you know what columns to apply it to, then do for only those cols with df[df[cols] > 0]: >>> cols = ['b'] >>> df[cols] = df[df[cols] > 0][cols]Read more

    • 0
  9. The following technique is not limited to use with filter and can be applied far more generally. Setup I'll use @cᴏʟᴅsᴘᴇᴇᴅ setup Let df be: d1 d2 abc 0 5 1 8 1 13 8 6 2 9 4 7 3 9 16 15 4 1 20 9 Inplace update Use pd.DataFrame.update update will take the argument dataframe and alter the calling datafRead more

    • 0
  10. You can try this: import pandas as pd import numpy as np from datetime import datetime, timedelta date_today = datetime.now() days = pd.date_range(date_today, date_today + timedelta(7), freq='D') np.random.seed(seed=1111) data = np.random.randint(1, high=100, size=len(days)) df = pd.DataFrame({'testRead more

    • 0
close