我不小心创建了一个名为的文件:w.我设法通过使用zsh选项卡功能删除它.但我不能从我的git缓存中删除它.
git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: Gemfile
# modified: Gemfile.lock
# new file: config/newrelic.yml
#
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: :w
#
Run Code Online (Sandbox Code Playgroud)
然后
git rm :w
fatal: pathspec 'w' did not match any files
Run Code Online (Sandbox Code Playgroud) 我有以下代码试图绘制时间序列.请注意,我删除了第二列,因为它不相关.然后我放弃了第一行和最后一行.
import pandas as pd
activity = pd.read_csv('activity.csv', index_col=2)
activity = activity.ix[1:-1] #drop first and last rows due to invalid data
series = activity['activity']
series.plot()
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-10-36df40c11065> in <module>()
----> 1 series.plot()
.../pandas/tools/plotting.pyc in plot_series(series, label, kind, use_index,
rot, xticks, yticks, xlim, ylim,
ax, style, grid, logy,
secondary_y, **kwds)
1326 secondary_y=secondary_y, **kwds)
1327
-> 1328 plot_obj.generate()
1329 plot_obj.draw()
1330
.../pandas/tools/plotting.pyc in generate(self)
573 self._compute_plot_data()
574 self._setup_subplots()
--> 575 self._make_plot()
576 self._post_plot_logic()
577 self._adorn_subplots() …Run Code Online (Sandbox Code Playgroud) 我正在尝试运行generator-angular自耕农发电机.但安装并运行后,我收到以下错误
npm http GET https://registry.npmjs.org/core-util-is
npm http GET https://registry.npmjs.org/debuglog/0.0.2
npm http 304 https://registry.npmjs.org/core-util-is
npm http 304 https://registry.npmjs.org/debuglog/0.0.2
npm ERR! peerinvalid The package karma does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer karma-ng-html2js-preprocessor@0.1.0 wants karma@>=0.9
npm ERR! peerinvalid Peer karma-ng-scenario@0.1.0 wants karma@>=0.9
npm ERR! peerinvalid Peer grunt-karma@0.6.2 wants karma@~0.10.0
npm ERR! System Darwin 13.1.0
npm ERR! command "/Users/harrymoreno/.nvm/v0.11.11/bin/node" "/Users/harrymoreno/.nvm/v0.11.11/bin/npm" "install" "grunt-karma" "karma-ng-html2js-preprocessor" "karma-ng-scenario" "--save-dev"
npm ERR! cwd /Users/harrymoreno/programming/js/temp
npm ERR! node -v v0.11.11
npm ERR! npm …Run Code Online (Sandbox Code Playgroud) 我正在尝试在页面上使用 xpath,但出现错误 Uncaught DOMException: Failed to execute 'iterateNext' on 'XPathResult': The document has mutated since the result was returned.
xpath = document.evalutate('//a', document)
xpath.iterateNext()
Run Code Online (Sandbox Code Playgroud)
怎么了?
我正在使用https://books.agiliq.com/projects/django-admin-cookbook/en/latest/export.html上的食谱
class ExportCsvMixin:
def export_as_csv(self, request, queryset):
meta = self.model._meta
field_names = [field.name for field in meta.fields]
response = HttpResponse(content_type='text/csv')
response['Content-Disposition'] = 'attachment; filename={}.csv'.format(meta)
writer = csv.writer(response)
writer.writerow(field_names)
for obj in queryset:
row = writer.writerow([getattr(obj, field) for field in field_names])
return response
export_as_csv.short_description = "Export Selected"
Run Code Online (Sandbox Code Playgroud)
效果很好,只是它不会导出我在管理面板中看到的所有列。我添加了一些像这样的额外列
class MeetingAdmin(admin.ModelAdmin, ExportCsvMixin):
actions = ["export_as_csv"]
list_display = (
"__str__",
"expert_network",
)
def expert_network(self, obj):
if obj.expert:
return obj.expert.network.name
else:
return "-"
Run Code Online (Sandbox Code Playgroud)
是否可以改进 ExportCsvMixin 以导出可调用的 list_display 字段?
我目前正在尝试循环 list_display 但我不知道如何使用可调用对象
class ExportCsvMixin: …Run Code Online (Sandbox Code Playgroud) 我有一个列的数据集,目前被视为1000+级别的因素.这些是列的值.我想清理这些数据.有些值是字符串,如"-18 + 5 = -13"和"5 - 18 = -13",我希望聚类以不同于"R3no4"的方式对这些进行分组.
这可能在R?我查看了自然语言处理任务视图http://cran.r-project.org/web/views/NaturalLanguageProcessing.html但我需要向正确的方向推进.
数据集来自kdd 2010杯 我想从这个专栏创建有意义的新专栏,以帮助创建预测模型.例如,知道字符串是否包含某个操作,或者它是否包含没有操作而是描述问题会很好.
我的数据框看起来像这样:
str(data1)
'data.frame': 809694 obs. of 19 variables:
$ Row : int 1 2 3 4 5 6 7 8 9 10 ...
$ Anon.Student.Id : Factor w/ 574 levels "02i5jCrfQK","02ZjVTxC34",..: 7 7 7 7 7 7 7 7 7 7 ...
$ Problem.Hierarchy : Factor w/ 138 levels "Unit CTA1_01, Section CTA1_01-1",..: 80 80 80 80 80 80 80 80 80 80 ... …Run Code Online (Sandbox Code Playgroud) 我有一个小提琴http://jsfiddle.net/nLhgT/ 我按照这里的说明http://davidwalsh.name/css-flip和http://desandro.github.io/3dtransforms/docs/card-flip.html当我翻转卡片时,只显示正面(翻转).我似乎无法得到背面展示.我在stackoverflow上读过类似的问题,说必须首先旋转背面.它确实在我的例子中最初旋转.
HTML
<ul>
<li>
<div class="container">
<div class="card">
<div class="front">
front
</div>
<div class="back">
back
</div>
</div>
</div>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
CSS
li {
width: 300px;
height: 260px;
position: relative;
perspective: 800px;
list-style-type: none;
}
.card {
width: 100%;
height: 100%;
position: absolute;
transform-style: preserve-3d;
-webkit-transition-duration: 400ms;
transition-duration: 400ms;
}
.card div {
display: block;
position: absolute;
width: 100%;
height: 100%;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.card .front {
background: red;
}
.card .back { …Run Code Online (Sandbox Code Playgroud) 我需要更改我的React Native Android项目的名称.我换了我的app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.[new name here]">
但是当我尝试构建一个版本apk时,我收到以下错误
:app:compileReleaseJavaWithJavac
/Users/harrymoreno/programming/contactsPro/android/app/src/main/java/com/contactspro/MainActivity.java:34: error: cannot find symbol
.setUseDeveloperSupport(BuildConfig.DEBUG)
^
symbol: variable BuildConfig
location: class MainActivity
1 error
:app:compileReleaseJavaWithJavac FAILED
Run Code Online (Sandbox Code Playgroud) 我想将一些 flac 声音文件输入到 keras 模型中。使用 wavfiles 我可以做(人为的示例,一个音频文件使用了两次)
import scipy.io.wavfile
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.optimizers import SGD
path = 'path/to/file.wav'
_, audio = scipy.io.wavfile.read(path)
dataset = [audio, audio]
x_train = np.array(dataset)
y_train = keras.utils.to_categorical([0, 1], num_classes=2)
model = Sequential()
model.add(Dense(32, activation='relu', input_shape=x_train[0].shape))
model.add(Dense(2, activation='softmax'))
model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])
model.fit(x_train, y_train, epochs=10, batch_size=32)
Run Code Online (Sandbox Code Playgroud)
我该如何使用 flac 文件执行此操作?
我可以在整个项目上运行 jsdoc
$ jsdoc -r .
Run Code Online (Sandbox Code Playgroud)
然而,这会生成 .js 文件内的 js 文件的文档node_modules。我如何告诉 jsdoc 不在 中的文件上运行.gitignore?
android ×1
apk ×1
css ×1
css3 ×1
csv ×1
django ×1
django-admin ×1
dom ×1
filenames ×1
flac ×1
git ×1
gradle ×1
html ×1
javascript ×1
jsdoc ×1
karma-runner ×1
librosa ×1
matplotlib ×1
npm ×1
nvm ×1
pandas ×1
python ×1
python-3.x ×1
r ×1
react-native ×1
scipy ×1
unix ×1
xpath ×1
yeoman ×1