I first took this data in a text file below: And I changed it into a list like this: I then removed everything with a colon. And my next step in the program below is to manually merge ‘second’ and ‘text’ and then ‘sec’ and ‘text’. This wont work in a program wit…
Images not hosted on server with flask, jinja2 and html
I want to load images from links with flask and jinja2. This is what I’m trying: I have checked that anime.cover = https://animeflv.net/uploads/animes/covers/2430.jpg, but the images won’t load. What is a possible solution? Thank you in advance! Answer First check to make sure you’re getting…
transformers AutoTokenizer.tokenize introducing extra characters
I am using HuggingFace transformers AutoTokenizer to tokenize small segments of text. However this tokenization is splitting incorrectly in the middle of words and introducing # characters to the tokens. I have tried several different models with the same results. Here is an example of a piece of text and the…
Problems Removing Duplicated Words from Pandas Row
I am working on an NLP assignment and having some problems removing duplicated strings from a pandas column. The data I am using is tagged, so some of the rows of data were repeated because the same comment could have multiple tags. So what I did was group the data by ID and Comment and aggregated based on ta…
Converting a Dictionary to DataFrame in Python
I have a dictionary of a static structure: I will need to record data a few extra keys deep to the same depth, so somewhat uniform. Example Dictionary: I want a DataFrame of this structure: Example Desired DataFrame: Where all Child Values are either a list object of strings or a string object. From researchi…
How do I pass inputs from jQuery to Flask?
I have three inputs I am trying to pass the values back to a function inside my app, from the index.html rendered in Flask. Here are the inputs: Here is the script to assign and render their values on the page (for Rate and Percent of income sliders) as well as my start at trying to pass the values. Here
calculate number of non-missing counts in specific columns
I have a data like below: I want to get count of non-missing based on F and L: I tried below’s code but got wrong result since it considered F and L separate instead of based on their suffix: Any idea? Answer
Convert a CSV into a JSON using a JSON Schema
How do I convert a flat table into a JSON? I have previously converted JSONs into Flat Tables using both custom code and libraries. However, what I am aiming to do here is the reverse. Before going ahead and creating a custom library, I was wondering if anyone had encountered this problem before and if there …
how can I strip the 00:00:00 from a date in python
This might be a really simple question, but I’m using the code below to add 1 day to a date and then output the new date. I found this code online. this code works but the output its gives me looks like this but for the rest of my code to run properly I need to get rid of the
Giving output of one neural network as an input to another in pytorch
I have a pretrained convolution neural network which produces and output of shape (X,164) where X is the number of test examples. So output layer has 164 nodes. I want to take this output and give this two another network which is simply a fully connected neural network whereby the first layer has 64 nodes an…