I have a similarity matrix of words and would like to apply an algorithm that can put the words in clusters. Here’s the example I have so far: Obviously this is a very simple dummy example, but what I would expect the output to be is 2 clusters, one with ‘The Bachelor’,’The Bachelorette’,’The Bachelor Special’, and the other with ‘SportsCenter’,’SportsCenter
how to install python modules where pipy.org is is not accessible from iran?
so the problem is that pypi.org hase been filtered by iranian government(yes , i know it’s ridiculous!). i tried to install some python modules from Github downloaded files: pip install moduleName but every module has it’s own dependencies and try to connect to pipy.org to reach them. then there will be an error during installation. is there any solution? your
a bytes-like object is required, not ‘str’ while parsing XML files
I am trying to parse an xml that looks like this. I want to extract information regarding the katagorie i.e ID, parent ID etc: I am trying this but I get this error: even though I am already using encode(‘utf-8’) in my code. How can I get rid of this error? Answer EDIT 2 If want to find regarding nested
Dynamic subplot using Figures in Matplotlib
I want to create a subplot using matplotlib with pysimplegui where each time i select some signals-checkbox(list of values) i should get a plot corresponding to it which will dynamically increase or decrease in size based on my selection so when i select a checkbox the respective plot will be plotted and eqaully spaced and when i deselect a plot
How to create a tensor from a list of matrices in numpy?
How do I create a tensor T that is 3x2x3; as in, T[:,:,0] = A, T[:,:,1] = B, and T[:,:,2] = C? Also I may not know the number of matrices that I may be given before run time, so I cannot explicitly create an empty tensor before hand and fill it. I tried, but that gives me an array
Appending 1D Ndarray to 2D Ndarray
I’m attempting to append a 1D array which have generated by appending elements one at a time to a 2D array as a new row in the array. I’m pretty lost as to why this code doesn’t work? They are both arrays of 5 elements, but get the following error? “ValueError: all the input arrays must have same number of
Secured endpoints in FastApi using enum
In my app, I want to apply access to a given endpoint based on a role, which is an enum. The way it all works is that a logged in (authorized) user, wants to get access to some resources, or create a new user etc…, then his jwt token is decoded, so we can see his roles (enum). I’m going
Regex : split on ‘.’ but not in substrings like “J.K. Rowling”
I am looking for names of books and authors in a bunch of texts, like: Right now I am using the following code to split the text on separators like this: Even if there are false positive (like ‘that’s it by the way’) my main problem is with authors that are cut when written as initials, which is pretty common.
Question about Packaging in Python with pip
I saw this nice explanation video (link) of packaging using pip and I got two questions: The first one is: I write a code which I want to share with my colleagues, but I do not aim to share it via pypi. Thus, I want to share it internally, so everyone can install it within his/ her environment. I actually
Convert nested dict to dataframe, syntax error?
Problem I am converting multiple nested dicts to dataframes. I have a slightly different dict that I haven’t been able to convert to a dataframe using my attempted solution. I am providing a shortened copy of my dict with dummy values as the reprex. Reprex dict: My attempted solution Code is based on similar dict wrangling problems that I had,