Updated code using ravel() and now able to set values based on an array. A tradeoff has to be made between code duplication and memory usage. Making everything into the same shape would be the most elegant, but A[:, :] = 1 would generate three arrays (i, j, x) all having the same size as A. If there is desire to simplify the code, that can be easily done.
Updated code using ravel() and now able to set values based on an array. A
tradeoff has to be made between code duplication and memory usage. Making
everything into the same shape would be the most elegant, but A[:, :] = 1
would generate three arrays (i, j, x) all having the same size as A. If there
is desire to simplify the code, that can be easily done.

matthewalbani/scipy,arokem/scipy,argriffing/scipy,jonycgn/scipy,sauliusl/scipy,cpaulik/scipy,mortonjt/scipy,bkendzior/scipy,fernand/scipy,jsilter/scipy,niknow/scipy,woodscn/scipy,maciejkula/scipy,vhaasteren/scipy,rgommers/scipy,gfyoung/scipy,piyush0609/scipy,dch312/scipy,niknow/scipy,Stefan-Endres/scipy,Gillu13/scipy,ales-erjavec/scipy,e-q/scipy,vberaudi/scipy,lhilt/scipy,sonnyhu/scipy,newemailjdm/scipy,jor-/scipy,jsilter/scipy,felipebetancur/scipy,aarchiba/scipy,sriki18/scipy,ales-erjavec/scipy,richardotis/scipy,felipebetancur/scipy,arokem/scipy,raoulbq/scipy,pschella/scipy,tylerjereddy/scipy,anntzer/scipy,gef756/scipy,mdhaber/scipy,vigna/scipy,anntzer/scipy,mortonjt/scipy,anielsen001/scipy,jseabold/scipy,giorgiop/scipy,ilayn/scipy,grlee77/scipy,jamestwebber/scipy,Gillu13/scipy,haudren/scipy,zerothi/scipy,sriki18/scipy,nmayorov/scipy,sargas/scipy,petebachant/scipy,jor-/scipy,Shaswat27/scipy,kleskjr/scipy,matthew-brett/scipy,endolith/scipy,jonycgn/scipy,jseabold/scipy,sriki18/scipy,petebachant/scipy,jonycgn/scipy,ilayn/scipy,perimosocordiae/scipy,vigna/scipy,aarchiba/scipy,ortylp/scipy,matthewalbani/scipy,jamestwebber/scipy,anntzer/scipy,pbrod/scipy,surhudm/scipy,fredrikw/scipy,Eric89GXL/scipy,larsmans/scipy,hainm/scipy,aman-iitj/scipy,sargas/scipy,jor-/scipy,Dapid/scipy,trankmichael/scipy,mtrbean/scipy,mikebenfield/scipy,ilayn/scipy,piyush0609/scipy,mortada/scipy,WillieMaddox/scipy,sonnyhu/scipy,sriki18/scipy,mgaitan/scipy,zaxliu/scipy,kleskjr/scipy,pizzathief/scipy,ndchorley/scipy,pnedunuri/scipy,woodscn/scipy,FRidh/scipy,chatcannon/scipy,person142/scipy,minhlongdo/scipy,jseabold/scipy,mortonjt/scipy,juliantaylor/scipy,gef756/scipy,befelix/scipy,newemailjdm/scipy,sonnyhu/scipy,nmayorov/scipy,gertingold/scipy,haudren/scipy,arokem/scipy,WarrenWeckesser/scipy,petebachant/scipy,Eric89GXL/scipy,felipebetancur/scipy,giorgiop/scipy,zerothi/scipy,zxsted/scipy,Dapid/scipy,anielsen001/scipy,rgommers/scipy,aeklant/scipy,apbard/scipy,vigna/scipy,giorgiop/scipy,pbrod/scipy,mingwpy/scipy,arokem/scipy,mhogg/scipy,maciejkula/scipy,richardotis/scipy,futurulus/scipy,vhaasteren/scipy,juliantaylor/scipy,perimosocordiae/scipy,felipebetancur/scipy,tylerjereddy/scipy,pschella/scipy,mdhaber/scipy,pizzathief/scipy,person142/scipy,woodscn/scipy,surhudm/scipy,behzadnouri/scipy,WarrenWeckesser/scipy,aarchiba/scipy,niknow/scipy,nonhermitian/scipy,scipy/scipy,e-q/scipy,newemailjdm/scipy,mikebenfield/scipy,kalvdans/scipy,pnedunuri/scipy,nvoron23/scipy,Kamp9/scipy,pschella/scipy,fredrikw/scipy,jsilter/scipy,e-q/scipy,dch312/scipy,cpaulik/scipy,newemailjdm/scipy,josephcslater/scipy,vberaudi/scipy,giorgiop/scipy,pyramania/scipy,Dapid/scipy,perimosocordiae/scipy,Newman101/scipy,apbard/scipy,gef756/scipy,argriffing/scipy,Kamp9/scipy,FRidh/scipy,larsmans/scipy,ndchorley/scipy,maciejkula/scipy,nonhermitian/scipy,petebachant/scipy,jakevdp/scipy,jakevdp/scipy,fernand/scipy,pnedunuri/scipy,gfyoung/scipy,njwilson23/scipy,surhudm/scipy,giorgiop/scipy,anntzer/scipy,gertingold/scipy,trankmichael/scipy,mgaitan/scipy,Shaswat27/scipy,jor-/scipy,richardotis/scipy,sargas/scipy,ogrisel/scipy,njwilson23/scipy,zxsted/scipy,endolith/scipy,ChanderG/scipy,Shaswat27/scipy,apbard/scipy,tylerjereddy/scipy,endolith/scipy,Srisai85/scipy,maciejkula/scipy,nonhermitian/scipy,gdooper/scipy,mingwpy/scipy,minhlongdo/scipy,argriffing/scipy,sauliusl/scipy,nvoron23/scipy,jjhelmus/scipy,kleskjr/scipy,Eric89GXL/scipy,jonycgn/scipy,petebachant/scipy,pbrod/scipy,argriffing/scipy,ndchorley/scipy,behzadnouri/scipy,aman-iitj/scipy,lukauskas/scipy,Dapid/scipy,lhilt/scipy,behzadnouri/scipy,pyramania/scipy,jjhelmus/scipy,futurulus/scipy,Kamp9/scipy,Srisai85/scipy,pnedunuri/scipy,haudren/scipy,ilayn/scipy,nvoron23/scipy,endolith/scipy,lhilt/scipy,mtrbean/scipy,sauliusl/scipy,niknow/scipy,aman-iitj/scipy,vhaasteren/scipy,mgaitan/scipy,nmayorov/scipy,ortylp/scipy,witcxc/scipy,sriki18/scipy,scipy/scipy,ogrisel/scipy,jjhelmus/scipy,grlee77/scipy,andyfaff/scipy,Dapid/scipy,Srisai85/scipy,larsmans/scipy,surhudm/scipy,befelix/scipy,pyramania/scipy,haudren/scipy,gdooper/scipy,mtrbean/scipy,grlee77/scipy,WillieMaddox/scipy,mortada/scipy,pbrod/scipy,sauliusl/scipy,lukauskas/scipy,Newman101/scipy,woodscn/scipy,vhaasteren/scipy,andim/scipy,behzadnouri/scipy,maniteja123/scipy,haudren/scipy,juliantaylor/scipy,anielsen001/scipy,pizzathief/scipy,aarchiba/scipy,maniteja123/scipy,niknow/scipy,person142/scipy,jsilter/scipy,mortonjt/scipy,aeklant/scipy,gfyoung/scipy,scipy/scipy,mortada/scipy,fernand/scipy,lukauskas/scipy,sargas/scipy,Stefan-Endres/scipy,aarchiba/scipy,rmcgibbo/scipy,witcxc/scipy,vberaudi/scipy,mhogg/scipy,gef756/scipy,ndchorley/scipy,mortada/scipy,chatcannon/scipy,piyush0609/scipy,mikebenfield/scipy,zxsted/scipy,Stefan-Endres/scipy,apbard/scipy,ilayn/scipy,pbrod/scipy,vhaasteren/scipy,kalvdans/scipy,befelix/scipy,dch312/scipy,bkendzior/scipy,matthew-brett/scipy,Srisai85/scipy,ndchorley/scipy,pizzathief/scipy,matthew-brett/scipy,juliantaylor/scipy,matthewalbani/scipy,efiring/scipy,Shaswat27/scipy,sargas/scipy,zxsted/scipy,sonnyhu/scipy,pnedunuri/scipy,petebachant/scipy,ChanderG/scipy,ogrisel/scipy,vanpact/scipy,WillieMaddox/scipy,haudren/scipy,pnedunuri/scipy,grlee77/scipy,WillieMaddox/scipy,ales-erjavec/scipy,hainm/scipy,njwilson23/scipy,matthewalbani/scipy,bkendzior/scipy,sriki18/scipy,WarrenWeckesser/scipy,witcxc/scipy,apbard/scipy,mgaitan/scipy,WillieMaddox/scipy,WillieMaddox/scipy,nvoron23/scipy,fredrikw/scipy,richardotis/scipy,ortylp/scipy,trankmichael/scipy,andyfaff/scipy,raoulbq/scipy,futurulus/scipy,pizzathief/scipy,trankmichael/scipy,minhlongdo/scipy,mingwpy/scipy,Stefan-Endres/scipy,mdhaber/scipy,bkendzior/scipy,njwilson23/scipy,andyfaff/scipy,chatcannon/scipy,gertingold/scipy,efiring/scipy,chatcannon/scipy,lhilt/scipy,jamestwebber/scipy,rmcgibbo/scipy,piyush0609/scipy,mtrbean/scipy,bkendzior/scipy,zaxliu/scipy,argriffing/scipy,mhogg/scipy,vberaudi/scipy,rmcgibbo/scipy,matthewalbani/scipy,surhudm/scipy,josephcslater/scipy,mdhaber/scipy,rmcgibbo/scipy,fredrikw/scipy,andim/scipy,ales-erjavec/scipy,lukauskas/scipy,arokem/scipy,jakevdp/scipy,ales-erjavec/scipy,endolith/scipy,jseabold/scipy,perimosocordiae/scipy,fredrikw/scipy,scipy/scipy,jseabold/scipy,ndchorley/scipy,ogrisel/scipy,fredrikw/scipy,andyfaff/scipy,sauliusl/scipy,andim/scipy,efiring/scipy,zerothi/scipy,lukauskas/scipy,kleskjr/scipy,dominicelse/scipy,kleskjr/scipy,cpaulik/scipy,ilayn/scipy,minhlongdo/scipy,Newman101/scipy,dch312/scipy,vigna/scipy,fernand/scipy,befelix/scipy,FRidh/scipy,aeklant/scipy,scipy/scipy,zxsted/scipy,mhogg/scipy,raoulbq/scipy,piyush0609/scipy,ChanderG/scipy,piyush0609/scipy,vigna/scipy,rgommers/scipy,Stefan-Endres/scipy,maniteja123/scipy,tylerjereddy/scipy,larsmans/scipy,mortada/scipy,ChanderG/scipy,gertingold/scipy,felipebetancur/scipy,gef756/scipy,ales-erjavec/scipy,maniteja123/scipy,rgommers/scipy,raoulbq/scipy,zerothi/scipy,sonnyhu/scipy,newemailjdm/scipy,Dapid/scipy,fernand/scipy,behzadnouri/scipy,mtrbean/scipy,Kamp9/scipy,aman-iitj/scipy,vhaasteren/scipy,pschella/scipy,lukauskas/scipy,josephcslater/scipy,raoulbq/scipy,josephcslater/scipy,josephcslater/scipy,witcxc/scipy,juliantaylor/scipy,maniteja123/scipy,Srisai85/scipy,minhlongdo/scipy,mortonjt/scipy,mdhaber/scipy,fernand/scipy,Srisai85/scipy,dominicelse/scipy,Shaswat27/scipy,vanpact/scipy,gef756/scipy,rmcgibbo/scipy,zerothi/scipy,pschella/scipy,vberaudi/scipy,kleskjr/scipy,dch312/scipy,nonhermitian/scipy,anielsen001/scipy,vanpact/scipy,Newman101/scipy,mikebenfield/scipy,surhudm/scipy,Shaswat27/scipy,richardotis/scipy,vanpact/scipy,richardotis/scipy,vanpact/scipy,andyfaff/scipy,Gillu13/scipy,gertingold/scipy,aman-iitj/scipy,zaxliu/scipy,giorgiop/scipy,jjhelmus/scipy,mhogg/scipy,jonycgn/scipy,anntzer/scipy,raoulbq/scipy,nmayorov/scipy,larsmans/scipy,scipy/scipy,e-q/scipy,vanpact/scipy,chatcannon/scipy,felipebetancur/scipy,FRidh/scipy,ortylp/scipy,mingwpy/scipy,WarrenWeckesser/scipy,andyfaff/scipy,mortada/scipy,perimosocordiae/scipy,hainm/scipy,zaxliu/scipy,WarrenWeckesser/scipy,dominicelse/scipy,andim/scipy,pyramania/scipy,sauliusl/scipy,FRidh/scipy,WarrenWeckesser/scipy,jamestwebber/scipy,nonhermitian/scipy,tylerjereddy/scipy,mtrbean/scipy,zxsted/scipy,e-q/scipy,anielsen001/scipy,jor-/scipy,Stefan-Endres/scipy,gfyoung/scipy,gdooper/scipy,njwilson23/scipy,andim/scipy,jseabold/scipy,zerothi/scipy,Eric89GXL/scipy,anntzer/scipy,anielsen001/scipy,mingwpy/scipy,aeklant/scipy,futurulus/scipy,zaxliu/scipy,gdooper/scipy,Newman101/scipy,cpaulik/scipy,niknow/scipy,maciejkula/scipy,mgaitan/scipy,ChanderG/scipy,nmayorov/scipy,efiring/scipy,ChanderG/scipy,mingwpy/scipy,jsilter/scipy,woodscn/scipy,matthew-brett/scipy,Kamp9/scipy,jakevdp/scipy,perimosocordiae/scipy,matthew-brett/scipy,hainm/scipy,FRidh/scipy,mhogg/scipy,kalvdans/scipy,minhlongdo/scipy,jonycgn/scipy,trankmichael/scipy,aeklant/scipy,grlee77/scipy,newemailjdm/scipy,larsmans/scipy,mgaitan/scipy,rgommers/scipy,rmcgibbo/scipy,jjhelmus/scipy,behzadnouri/scipy,nvoron23/scipy,futurulus/scipy,gfyoung/scipy,witcxc/scipy,kalvdans/scipy,Newman101/scipy,Gillu13/scipy,jakevdp/scipy,njwilson23/scipy,befelix/scipy,hainm/scipy,person142/scipy,nvoron23/scipy,lhilt/scipy,pyramania/scipy,mdhaber/scipy,hainm/scipy,ortylp/scipy,ortylp/scipy,ogrisel/scipy,sonnyhu/scipy,efiring/scipy,futurulus/scipy,kalvdans/scipy,zaxliu/scipy,jamestwebber/scipy,mikebenfield/scipy,dominicelse/scipy,Eric89GXL/scipy,woodscn/scipy,person142/scipy,dominicelse/scipy,Gillu13/scipy,aman-iitj/scipy,mortonjt/scipy,cpaulik/scipy,maniteja123/scipy,Eric89GXL/scipy,Gillu13/scipy,argriffing/scipy,chatcannon/scipy,Kamp9/scipy,gdooper/scipy,cpaulik/scipy,endolith/scipy,trankmichael/scipy,vberaudi/scipy,andim/scipy,efiring/scipy,pbrod/scipy