It checks the lib folder where my seaborn stuff is, but still error._. Hi, I have looked at other posts, but most seemed to be dealing with Jupyter notebooks, which I’m not. I was wondering how to get to use Seaborn in the basic Python IDE or in PyCharm. I read about filepath collisions stuff, but not too clear on
Tag: python-3.x
How to create rank column in Python based on other columns
I have a python dataframe that looks like the following: This dataframe has been sorted in descending order by ‘transaction_count’. I want to create another column in that dataframe called ‘rank’ that contains the count of occurrences of cust_ID. My desired output would look something like the following: For cust_ID = 1234 with transaction_count = 4, the rank would be
python3 : The term ‘python3’ is not recognized as the name of a cmdlet, function, script file, or operable program
python3 : The term ‘python3’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Answer Make sure you add python to your system path And try using python not python3 And try to
How to fix “SystemError: returned NULL without setting an error” in Python C Extension
Tools: Python3.7 (64 bit), Visual C++ 10.0 I am trying to create a C extension for Python. To start, I am testing a simple C code which prints a string and invokes the Sleep() function inside a for loop. However, when I make a simple call to this C function, named gen_nums, from Python, I get the following error: “SystemError:
pandas.concat two data frames (one with and one without headers)
I have two data frames, that I am trying to combine. A json file with headers: And an Excel file with data in the same format, but without headers: I am trying to achieve the data frame below: My code: Problem: When I run my code, the combined data frame looks like this: I have tried the concat function with
How do I zip an entire folder (with subfolders) and serve it through Flask without saving anything to disk
I have a folder structure on my web server that I would like to serve as a zipped archive through Flask. Serving a file through Flask is pretty straight forward through Flasks send_file: Zipping can get accomplished in various ways like with shutil.make_archive or zipfile, but i cannot figure out how to zip the whole directory in memory and then
Make Tkinter Notebook draggable
A similar question was asked back in ’15 Make Tkinter Notebook be Draggable to Another View but that was a while ago and that also asked about re-binding the window. I was wondering how I would make a notebook draggable, even if is just to reorder the tabs. Any advice would be helpful and please let me know if this
supposedly incorrect output np.reshape function
I have an array called “foto_dct” with shape (16,16,8,8) which means 16×16 matrices of 8×8. When I print foto_dct[0,15], being the last matrix of the first row I get: when i do foto_dct_big = np.reshape(foto_dct,(128,128)) and print foto_dct_big I get this: As you can see is the top righter corner( which is supposed to be the matrix above with all
What does format=None do in Django rest full API
Recently when I read Django rest full API document I faced this code : this code is work fine but I look for format=None and I cant find out what does it do. is any body know what is it and why its important to be? Answer The django rest framework (drf) documentation explains it here. The gist of it
AttributeError: module ‘asyncio’ has no attribute ‘create_task’
I’m trying to asyncio.create_task() but I’m dealing with this error: Here’s an example: Out: So I tried with the following code snippet (.ensure_future()) instead, without any problem: Out: What’s wrong? [NOTE]: Python 3.6 Ubuntu 16.04 [UPDATE]: With borrowing from @user4815162342 Answer, my problem solved: Answer The create_task top-level function was added in Python 3.7, and you are using Python 3.6.