தீர்க்கப்பட்டது: போஸ்ட் மேட்ரிக்ஸில் இருந்து ஜாங்கோ பிரித்தெடுத்தல் வரிசை

முக்கிய பிரச்சனை என்னவென்றால், ஜாங்கோ போஸ்ட் மேட்ரிக்ஸில் இருந்து வரிசையை ஒரு பைதான் பட்டியலாக பிரித்தெடுக்கிறது, மாறாக NumPy வரிசையாக பிரித்தெடுக்கிறது. வரிசையில் எந்த வகையான கணித செயல்பாடுகளையும் நீங்கள் செய்ய வேண்டியிருந்தால் இது சிக்கல்களுக்கு வழிவகுக்கும், ஏனெனில் NumPy வரிசைகள் அந்த வகையான வேலைகளுக்கு மிகவும் திறமையானவை.

எனது HTML பக்கத்தில் ஒரு மேட்ரிக்ஸ் உள்ளது, அதை எனது ஜாங்கோ பார்வையில் இடுகையிடுகிறேன். மேட்ரிக்ஸ் என்பது பட்டியல்களின் பட்டியல், மேலும் இடுகையிடப்பட்ட தரவிலிருந்து தனிப்பட்ட பட்டியல்களைப் பிரித்தெடுக்க விரும்புகிறேன். நான் இதை எப்படி செய்ய முடியும்?
இதுவரை என்னிடம் இருப்பது இதோ:
def myview(request):
if request.method == 'POST': # If the form has been submitted...
form = MyForm(request.POST) # A form bound to the POST data

if form.is_valid(): # All validation rules pass

# Process the data in form.cleaned_data

return HttpResponseRedirect('/thanks/') # Redirect after POST

else:
form = MyForm() # An unbound form

return render(request, 'mytemplate.html', {'form':form})

In mytemplate.html, இது போன்ற தேர்வுப்பெட்டிகளின் மேட்ரிக்ஸ் என்னிடம் உள்ளது:
<table><tr><td>1,1 <input type="checkbox" name="matrix[0][0]" value="1" /> </td> <td> 1,2 <input type="checkbox" name="matrix[0][1]" value="1" />" </td>" <"td"="" 1,3="" "="" input="" type="checkbox" name=matrix[0][2] value=1 /"" ""="" td="" tr="" table="" xtml-space:"preserve"" xmlns:xtml-space="http://www." w3corg/xml/1998/namespace"" xmlns_w3corg="/xmlns/" xml:"lang=en-us"" lang=en-us"" http://www."" w3corg/1999xhtml"" xmlns_w3corg="/1999/" html:"xmlns=http://www."" w3corg/" lang=en-us""" class="container">2,1 &"nbsp;" 2,2 "nbsp;" 2," 3 "nbsp;" 3," 1 "nbsp;" 3," 2 "nbsp;" 3," 3 "nbsp;" 4," 1 "nbsp;" 4," 2 "nbsp;" 4," 3 "" nbsp ; "" 5 , "" 1 "" nbsp ; "" 5 , "" 2 "" nbsp ; "" 5 , """ 6 ," """ 7 ," """ 8 ," """ 9 ," """ 10 ," """ 11 ," """ 12 ," """ 13 ," """ 14 , "
rntttt14,2
rn t t t 14

Related posts:

Leave a Comment