我正在使用 jupyter 笔记本并安装。
ipywidgets==7.4.2 widgetsnbextension pandas-profiling=='.0.0
Run Code Online (Sandbox Code Playgroud)
我也跑了:
!jupyter nbextension enable --py widgetsnbextension
Run Code Online (Sandbox Code Playgroud)
但运行时:
from pandas_profiling import ProfileReport
profile = ProfileReport(df, title="Pandas Profiling Report", explorative=True)
profile.to_widgets()
Run Code Online (Sandbox Code Playgroud)
我收到错误:
ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
Run Code Online (Sandbox Code Playgroud)
知道为什么吗?尝试了建议的解决方案。
我有一个包含 3 列的数据框。我保存pd.to_csv(filename)
然后重新打开它
pd.read_csv(filename, index_col=False)
Run Code Online (Sandbox Code Playgroud)
但是我得到了一个有 4 列的数据框,最左边的列称为
未命名:0
这实际上只是行号。没有它,我如何阅读 csv?
谢谢!
我有一台 mac,想安装 python 3.6 我试过:
$brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
Run Code Online (Sandbox Code Playgroud)
但得到:
Error: Calling Installation of python from a GitHub commit URL is disabled! Use 'brew extract python' to stable tap on GitHub instead.
Run Code Online (Sandbox Code Playgroud)
所以我试过:
$brew extract python https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
Run Code Online (Sandbox Code Playgroud)
但得到:
Error: Invalid tap name 'https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb'
Run Code Online (Sandbox Code Playgroud)
我该怎么办?
我正在尝试从python中的TIMIT数据库中读取一个wav文件,但是我收到一个错误:
当我使用wave时:
wave.Error: file does not start with RIFF id
Run Code Online (Sandbox Code Playgroud)
当我使用scipy时:
ValueError: File format b'NIST'... not understood.
Run Code Online (Sandbox Code Playgroud)
当我使用librosa时,程序卡住了.我尝试使用sox将其转换为wav:
cmd = "sox " + wav_file + " -t wav " + new_wav
subprocess.call(cmd, shell=True)
Run Code Online (Sandbox Code Playgroud)
它没有帮助.我看到一个引用scikits.audiolab包的旧答案,但看起来它不再受支持了.
如何读取这些文件以获取数据的数据?
谢谢
我想在数据框中的每一行应用一个函数。我正在使用 apply() 但它传递了一个 Series 对象,因此未传递列名称。有没有办法使用 .apply() 并保留列名称?
我从 anaconda 环境中打开了一个 jupyter 笔记本,但内核使用默认版本的 python 而不是在这个环境中定义的 python(它有我安装的所有 pthe 包)。
我怎样才能改变它?
(myEnv) okoub@my-mac:~/Desktop$jupyter notebook
[I 13:35:46.644 NotebookApp] The port 8888 is already in use, trying another port.
[I 13:35:46.646 NotebookApp] The port 8889 is already in use, trying another port.
[I 13:35:46.675 NotebookApp] JupyterLab alpha preview extension loaded from /Users/okoub/anaconda3/lib/python3.6/site-packages/jupyterlab
Run Code Online (Sandbox Code Playgroud)
我正在使用MAC。
在环境中安装jupyter后:
source activate myEnv
conda install jupyter
jupyter notebook
Run Code Online (Sandbox Code Playgroud)
我收到错误:
File "/Users/okoub/anaconda3/envs/myEnv/lib/python3.5/site-packages/prompt_toolkit/completion/base.py", line 4, in <module>
from prompt_toolkit.eventloop import generator_to_async_generator, AsyncGeneratorItem
ImportError: cannot import name 'generator_to_async_generator'
[W 14:54:56.587 NotebookApp] …Run Code Online (Sandbox Code Playgroud) 我有数据框:
subject A_target_word_gd A_target_word_fd B_target_word_gd B_target_word_fd subject_type
1 1 2 3 4 mild
2 11 12 13 14 moderate
Run Code Online (Sandbox Code Playgroud)
我想将其融合为一个数据框,如下所示:
cond subject subject_type value_type value
A 1 mild gd 1
A 1 mild fg 2
B 1 mild gd 3
B 1 mild fg 4
A 2 moderate gd 11
A 2 moderate fg 12
B 2 moderate gd 13
B 2 moderate fg 14
...
...
Run Code Online (Sandbox Code Playgroud)
意思是,根据列名称的分隔符来融化。
最好的方法是什么?
我在 mac 上使用 conda 环境,我想安装 pyAudio。我试图按照许多线程中的建议运行
brew install portaudio
Run Code Online (Sandbox Code Playgroud)
r
pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
Run Code Online (Sandbox Code Playgroud)
但它仍然无法在conda 环境中工作。然而,运行
pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
Run Code Online (Sandbox Code Playgroud)
在 conda 环境之外工作(在“基础”环境中)。
可能是什么原因?如何在 conda 环境中安装 pyAudio?
我有一个包含希伯来语单词的数据框。我曾经df.to_csv(encoding='utf-8')写过它,但文字表达得不好:
当在文本编辑中打开它时,我可以正确看到希伯来语。我使用的是带有 Python3 和 Microsoft Excel 16.16 的 Mac。有什么想法如何修复它吗?
pandas ×6
python ×5
data-science ×3
dataframe ×3
python-3.x ×3
macos ×2
anaconda ×1
apply ×1
audio ×1
csv ×1
data-munging ×1
excel ×1
hebrew ×1
homebrew ×1
ipywidgets ×1
jupyter ×1
melt ×1
pyaudio ×1
scipy ×1
wav ×1
wave ×1
yellowbrick ×1