问题描述
我在使用接口信号遍历numpy矩阵时遇到麻烦。 我试图手动强制转换“ addr”,但它不起作用。 这是我的代码:
protected function runQueryCallback($query,$bindings,Closure $callback)
{
try {
$result = $callback($query,$bindings);
}
catch (Exception $e) {
throw new QueryException(
$query,$this->prepareBindings($bindings),$e
);
}
return $result;
}
这是我收到的错误消息。
IndexError:在模块“ /”中,只有整数,切片(
import React,{ Component } from 'react'; import { connect } from 'react-redux'; import '../CSS/FileSelectorCSS.css'; var CryptoJS = require("crypto-js"); class FileSelectorComponent extends Component { state = { // Initially,no file is selected selectedFile: null }; // On file select (from the pop up) onFileChange = event => { var text = ''; // Update the state this.setState({ selectedFile: event.target.files[0] }); var reader = new FileReader(); reader.onloadend = function () { text = (reader.result); } reader.readAsBinaryString(event.target.files[0]); var hash = CryptoJS.MD5(CryptoJS.enc.Latin1.parse(text)); console.log(hash.toString()); }; // File content to be displayed after // file upload is complete fileData = () => { if (this.state.selectedFile) { return ( <div> <h2>File Details:</h2> <p>File Name: {this.state.selectedFile.name}</p> <p>File Type: {this.state.selectedFile.type}</p> <p> Last Modified:{" "} {this.state.selectedFile.lastModifiedDate.toDateString()} </p> </div> ); } }; render() { return ( <div> <div> <input type="file" onChange={this.onFileChange} /> </div> {this.fileData()} </div> ); } }
),省略号(@gear async def ram_model_data_drv(addr: Uint[8],*,data_type = b'dtype',num_of_commands = 1) -> Queue['data_type']: matrix = np.random.randint(10,size = (num_of_commands,10)) async with addr: for data,last in quiter(matrix[addr]): yield (data,last)
),numpy.newaxis(:
)和整数或布尔数组才是有效索引。 ram_model_drv“
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)