He, I have a server python script that listens on ip address ” and port 1337 and now I am trying to connect on the client side to that socket. But for some reason I cannot do that. If i will change the binding address to “127.0.0.1” it will work just fine, but I have been told to use this
Tag: python
How to fix a Mac base conda environment when sqlite3 is broken
I recently updated the Python version of my base conda environment from 3.8 to 3.9, using mamba update python=3.9, but I can no longer run IPython, because the sqlite3 package appears to be broken. Since I had another Python 3.9 environment that is still functional, I tried copying over the envs/py39/lib/sqlite3.36.0 and envs/py39/lib/python3.9/sqlite3 directories, as well as envs/py39/lib/python3.9/lib-dynload/_sqlite3.cpython-39-darwin.so because I
nothing provides __cuda needed by tensorflow-2.10.0-cuda112py310he87a039_0
I’m using mambaforge on WSL2 Ubuntu 22.04 with systemd enabled. I’m trying to install TensorFlow 2.10 with CUDA enabled, by using the command: And the command nvidia-smi -q from WSL2 gives: And my other enviroment works as expected: Then, it tries to install package version cuda112py39h9333c2f_1, winch uses Python 3.9, but I want Python 3.10. Whenever I try to install
how do i split a column into two in python on the basis of data in it
for instance the column i want to split is duration here, it has data points like – 110 or 2 seasons, i want to make a differerent column for seasons and in place of seasons in my current column it should say null as this would make the type of column int from string screenshot of my data i tried
Replacing String Text That Contains Double Quotes
I have a number series contained in a string, and I want to remove everything but the number series. But the double quotes are giving me errors. Here are examples of the strings and a sample command that I have used. All I want is 127.60-02-15, 127.60-02-16, etc. I have tried all sorts of methods (e.g., triple double quotes, single
How to import empty values to csv if not found? [Python, Scrapy, Web Scrapping]
I am writting my first web scrapping project and I want to scrap from booking.com. I’d like to scrap info about include breakfast in hotel. The problem is – I want every value to be [“Brekafast included”] or empty value [“”] if there is no info about it. If Im runnig my code (below) I only get few values [“Brekafast
how to delete the entire line if line has specific word in python
i have a .txt file like this: and i want to delete the entire line that include “pen” word like this: and i tried this —————————AND—————————— how i delete just the “pen” word in the .txt file Answer First you need to put the result on another file (myfile2) and you need to print on this file the lines thats
Transform a 3D numpy array to 1D based on column value
Maybe this is a very simple task, but I have a numpy.ndarray with shape (1988,3). I want to create a 1D array with shape=(1988,) that will have values corresponding to the column of my 3D array that has a value of 1. For example, How can I do this? Answer You can use numpy.nonzero: Output: array([0, 1, 2, 1, 0,
Extract data by looping though dates using pandas
I want to scrape exchange rate data from July 1 2021 to June 30 2022 by enumerating exchangeDate variable and save it to excel. Here is my code so far: How do I loop through all dates? Answer You can use something like this:
Finding <p style class using BeautifulSoup
I am trying to scrape MSFT’s income statement using code I found here: How to Web scraping SEC Edgar 10-K Dynamic data They use the ‘span’ class to narrow the search. I do not see a span, so I am trying to use the <p class with no luck. Here is my code, it is largely unchanged from the answer