Anaconda

Shape mismatch: if categories is an array, it has to be of shape (n_features,)

十年热恋 提交于 2021-01-29 17:01:04
问题 Here is the code I'm trying to execute to encode the values of the first column of my data set using dummy values. import numpy as py import matplotlib.pyplot as plt import pandas as pd DataSet = pd.read_csv('Data.csv') x=DataSet.iloc[:, :-1].values y=DataSet.iloc[:,3].values from sklearn.impute import SimpleImputer imputer=SimpleImputer(missing_values=py.nan,strategy='mean') imputer=imputer.fit(x[:, 1:3]) x[:, 1:3]=imputer.transform(x[:, 1:3]) from sklearn.preprocessing import OneHotEncoder

Understanding `conda install` (channel and packages)

安稳与你 提交于 2021-01-29 15:06:59
问题 I am trying to install fastai but I don't understand what they are trying to do with conda install . The man page of fastai says: conda install -c fastai -c pytorch -c anaconda fastai gh anaconda Does this mean: the channels to be used are fastai , pytorch and anaconda while the packages to be installed are fastai , gh and anaconda respectively? I think they want to install pytorch and fastai basically. But they don't even mention pytorch package. conda install seems to be done like this:

Use PyVimeo from Anaconda

限于喜欢 提交于 2021-01-29 13:15:15
问题 I'm trying to use the Vimeo API. In the documentation here it simply says to use pip install PyVimeo and it will install. Unfortunately that doesn't work for me. What I'm trying to accomplish is to be able to use the API to upload a bunch of videos to my PRO account. I've tried their support and they were not terribly helpful. Here's what I tried so far... Originally I tried in Anaconda with Python 3, the package tries to install and then ends with Command "python setup.py egg_info" failed

installed and then wanted to open the anaconda navigator on my laptop

陌路散爱 提交于 2021-01-29 13:13:32
问题 so i'm unable to open the anaconda navigator. here i tried the conda update --all command and this is what it showed (base) C:\Users\dell>conda update --all Collecting package metadata (current_repodata.json): done Solving environment: done Package Plan environment location: C:\Users\dell\anaconda3 The following packages will be downloaded: package | build ---------------------------|----------------- _anaconda_depends-2019.03 | py37_0 6 KB anaconda-custom | py37_1 3 KB astropy-4.0.1.post1 |

VS Code Python Interactive Window ImportError: cannot import name

为君一笑 提交于 2021-01-29 12:52:44
问题 I am running a Python script in the VS Code Python Interactive Window with an Anaconda environment using Python 3.7.4). My "Notebook File Root" setting is set to $(workspaceFolder). I am using a workspace with two project folders: apple connie connie has a couple of files relevant in this problem: connie/scripts/mongo_helpers.py connie/project/project_file.py The problem occurs when I run project_file.py in the Python Interactive Window. It tries to load the mongo_helpers file as a module.

PyTorch Cuda with anaconda not available

安稳与你 提交于 2021-01-29 10:37:00
问题 I'm using anaconda to regulate my environment, for a project i have to use my GPU for network training. I use pytorch for my project and i'm trying to get CUDA working. I installed cudatoolkit, numba, cudnn still, when i try this command: torch.cuda.is_available() I get "False" as output. This is my environment: # Name Version Build Channel blas 1.0 mkl bzip2 1.0.6 h470a237_2 conda-forge ca-certificates 2018.03.07 0 cairo 1.14.12 he6fea26_5 conda-forge certifi 2018.8.24 py35_1 cffi 1.11.5

Whenever I run a program in Python Shell I get a line that says RESTART: C:\… $

别来无恙 提交于 2021-01-29 10:05:29
问题 Whenever I run a program in Python Shell I get a line that says RESTART: C:\... $ . Restarting the program, using programs that did not have this issue in the past etc. do not seem to do anything. Thanks in advance for any advice! What is causing this? 回答1: That line means that the .py file has been executed in the python shell. It's a log statement to explicitly declare that your namespace is being cleared and the file is going to be ran fresh again. In simple words: The IDLE internally

Prevent conda from automatically downgrading python package

不羁岁月 提交于 2021-01-29 10:04:37
问题 I had problems with pandas-datareader package v0.81. To fix my problem, I had to upgrade the package to a newer version 0.9 by running the following command; conda install -c anaconda pandas-datareader Unfortunately, when I tried to upgrade conda packages later using the command conda update --all , pandas-datareader is downgraded back to v0.81. v0.81 is from conda-forge channel. What I want is the v0.9 from anaconda channel. Below is what I want. https://anaconda.org/anaconda/pandas

Anaconda installation modifying .bash_profile on Mac OS X

不打扰是莪最后的温柔 提交于 2021-01-29 09:42:02
问题 I installed Anaconda on my Mac (Mojave) and now whenever I start a shell it automatically activates the conda environment. This was totally fine until I realized some of the commands in my .bashrc were not being executed on startup. In particular, I had increased HISTSIZE and HISTFILESIZE but they always seemed to be stuck at their default values of 500. After some googling, I learnt that because of my anaconda installation, it was my .bash_profile that was being used on startup and not

Change R version when using rpy2 package in Jupyter notebook

痞子三分冷 提交于 2021-01-29 09:23:29
问题 I want to run a piece of R code with %%R in my python3-notebook. It works, but the problem is that the R version of the notebook is the 3.6.1, while the one in my RStudio is the 4.0.1. In fact when I run R.home() the paths are different. I tried to change the version using: os.environ['R_HOME'] = '/Library/Frameworks/R.framework/Resources' %load_ext rpy2.ipython but when I call it I have a lot of errors: /Users/guglielmo/opt/anaconda3/lib/python3.7/site-packages/rpy2/rinterface/__init__.py