Category "python"

is there a way to cluster tweets after vectorizing them?

I need to cluster tweets based on similarity between them, I am using dec2vec to vectorize them and now I need a way to cluster this vectors, also I tried kmean

'ListWrapper' object has no attribute 'get_config' error when doing gridsearch

I have to do grid search on my DNN. But I am getting an error on GridSearchCV function. Here is the code for creating and compiling the model I used and also wh

Python equivalent of `final field` in java in dataclass

Is it possible to have something like class MyAbstract { final int myFieldSomebodyHasToDefine; } class MyAbstractImplementation extends MyAbstract { fin

Python - Matching close strings in two separate arrays

I have two different arrays populated with a number of string values and I would like to compare the two arrays and find the matches. The main problem is that t

how to check if the 2d array contain the requirement, and if yes, return the toal score in python

I have a 5 * 5 two-dimensional array, and a dice will be thrown 25 times. For each throw, the user needs to put the value into the two-dimensional array. Becaus

Can I write posts for a personal Django blog website in static html files?

I'm pretty new to Django and have been experimenting making my own personal blog. General question I get that I can specify my blog post structure in models.py

What could be wrong with a Pandas DataFrame?

I couldn't make head or tail of this: I have a function that reads a bunch of csv files from a S3 bucket, concats them and returns the DataFrame: def create_df(

scraping NYT mini crossword stats gives 403 forbidden URL error

I'm trying to scrape my NYT mini crossword stats to then update a google sheet. But I'm having trouble with the login portion of the code. Here's my code so far

Global variable is not updated if it is from other .py file

As you know, the code: var = "flower" def update(): global var var = "forest" update() print(var) will properly modify the variable var, but if you do

python logging library init.py returns keyerror and acquireLock() is NoneType

Im absolutely not sure which library is causing this or what is causing this but i really would appreciate some help. Although the error isn't messing up with t

When I convert the obtained road network data into a geodataframes structure, why does the list element appear in the highway column?

import osmnx as ox G = ox.graph_from_place('成都市',network_type='all') G = ox.project_graph(G) ox.plot_graph(G) # 将图形

azure python SDK retrieve backup items from recoverservices(backup)

I was told to move my bash script that reports on VM backup status, also reports VMs that are not being backed up to Azure automation account. I picked python s

recursive finding longest path of same element in 2d list

I need to find the longest path of 0's in a 2d matrix recursively and can't figure out how to do it.( from a given (i , j) it can only move up, down, right or l

pyaudio Segmentation fault in termux

I am trying to run pyaudio (version: https://git.skeh.site/skeh/pyaudio) in termux, but nothing can be heard from my tablet and it prints out "Segmentation faul

Discord bot stopped working through Heroku, works fine offline

Solved! Answer below. EDIT: Cleaned up this post to keep it all clear. Here's the code for a simple GIF bot. The important thing is: this bot works offline, giv

Constructor __init__ is written to take two position arguments, but when used, reports the error that only 1 is allowed

I have a class and constructor I'm working on, and I added an extra parameter to __init__, and now I get the error, TypeError: FeatureDataset() takes 1 position

Failed building wheel for scikit-learn. Encountered error while trying to install package

I am trying to run a project from github. While installing its requirements, I get the following error: note: This error originates from a subprocess, and is li

Python - Find fewest number of rectangles that enclose a list of rectanges (while avoiding others)

I have lists of coordinates for "good" rectangles and "bad" rectangles. Rectangles may or may not be adjacent to others from either list, but will never overlap

My x-axis is messed up for huge datasets?

I am trying to plot a countplot using Seaborn library. The data-set is a huge dataset with lots of data of more than 100,000 entries and 67 columns. I have trie

i want to make urls

1.Link is "https://www.xyz.{country}/dp/{asin}" 2.I have to pick two things from csv file which country and asin. CSV file contains : Asin Country 0