anaconda

AttributeError: 'list' object has no attribute 'lower'. How to fix the code in order to have it convert to upper or lower?

AttributeError: 'list' object has no attribute 'lower'. How to fix the code in order to have it convert to upper or lower? Question: ` def removeDigits(str): return str.translate({ord(i): None for i in ‘0123456789’}) def fileinput(): with open(‘constant.txt’) as f: lines = f.readlines() print(‘Initial string: ‘, lines) res = list(map(removeDigits, lines)) print(‘Final string: ‘, res) print(‘Make …

Total answers: 1

How to lookup different dataframes and return the values?

How to lookup different dataframes and return the values? Question: Im trying to lookup the index in two different datframes and return the values. For example, in df1 i would like to lookup in df2 and return the same index and values. DF1 DF2 I would like my result to be like this. RESULTS Asked …

Total answers: 2

Python 3.9.12: f-string error – SyntaxError: invalid syntax

Python 3.9.12: f-string error – SyntaxError: invalid syntax Question: I am using Spyder with Python 3.9.12 Here is the code I have inside Spyder: user_input = (input(‘Please enter a number between 1 and 12:>>’ )) while (not user_input.isdigit()) or (int(user_input) < 1 or int(user_input) > 12): print(‘Must be an integer between 1 and 12’) user_input …

Total answers: 1

Spyder IDE with python 3.10 seems freezing when click run button, but it works fine if run a single line beforehand running the entire script

Spyder IDE with python 3.10 seems freezing when click run button, but it works fine if run a single line beforehand running the entire script Question: I have truble with last version of Spyder 5.4.0 with last version of Python 3.10.6. Spyder version: 5.4.0 (conda) Python version: 3.10.6 64-bit Qt version: 5.15.2 PyQt5 version: 5.15.7 …

Total answers: 1

Is a cloned Conda environment Similar to a Python virtual environment

Is a cloned Conda environment Similar to a Python virtual environment Question: Is a cloned conda environment similar to a Python Virtual Environment? conda create –clone arcgispro-py3 –name arcgispro-py3_clone Or are there any benefits to create a Visual Environment for this cloned environment? Asked By: Behseini || Source Answers: I think I understand what you’re …

Total answers: 1

cannot import name 'BisectingKMeans' from 'sklearn.cluster' (C:UsersAdministratoranaconda3libsite-packagessklearncluster__init__.py)

cannot import name 'BisectingKMeans' from 'sklearn.cluster' (C:UsersAdministratoranaconda3libsite-packagessklearncluster__init__.py) Question: When I try to use sklearn.cluster.BisectingKMeans in my jupyter notebook, an ImportError occured. It is said in the document that this method is new in version 1.1, and my scikit-learn version is 1.1.3. I was using the base environment so it’s not an issue of lacking package …

Total answers: 1

How to activate my environment in linux automatically using .bashrc

How to activate my environment in linux automatically using .bashrc Question: I would like to activate the environment that I created in Anaconda (myenv) automatically when linux server is opened. The myenv environment path is located in ‘/anaconda_env/personal/myenv’. I used the following command lines in .bashrc to automatically activate myenv. However, "base" environment is always …

Total answers: 1

jupyter notebook showing this message, ImportError: cannot import name 'encodestring' from 'base64'

jupyter notebook showing this message, ImportError: cannot import name 'encodestring' from 'base64' Question: I am new to python and jupyter notebook and I am using windows. Recently I installed Anaconda Navigator 2.3.1 and the python verson 3.9.13 on my computer. After entering the command jupyter notebook on the command-line, my browser doesn’t open jupyter notebook, …

Total answers: 2