[英]Proper way to return a map function
我有 map function。 我不清楚返回 map function 這兩項工作的最佳方式return data 和return row 在我閱讀 map 時,我認為這是正確的方法return row 返回 map function 的最佳方式是什么? ...
[英]Proper way to return a map function
我有 map function。 我不清楚返回 map function 這兩項工作的最佳方式return data 和return row 在我閱讀 map 時,我認為這是正確的方法return row 返回 map function 的最佳方式是什么? ...
[英]Python How to pass specific key from list of Dictionary to Map function
我有以下格式的數據: 我有 function 接受 2 個關鍵字參數 我無法提供語法或示例,我可以將特定鍵從字典列表傳遞到 Map function 以作為多線程運行import concurrent.futures data = [ { "name": "abc", ...
[英]Python: Call function that returns two strings inside map function
您好,我正在嘗試創建一個在 map function 內部調用的 function,拆分已作為輸入傳遞的字符串並返回兩個已處理的字符串。 在這里更容易理解的是我的代碼(它似乎沒有返回任何東西)。 任何建議,將不勝感激。 干杯! ...
[英]"Key" prop in map
新手在這里,很抱歉這個愚蠢的問題:) 如何將“鑰匙”道具放入這個 function 中? 代碼在ContactShadows上面。 我嘗試了很多方法,但我嘗試的所有方法都無法正常工作。 你能檢查一下並告訴我如何放置“鑰匙”道具嗎? 謝謝你 ...
[英]Using Map function inside of another Map function in React Js
我想使用 map function 將流派添加到我的電影搜索應用程序的輪播中。我有兩個 json 文件,其中一個是電影數據數組,作為具有 genre_ids 鍵的對象,例如: genre_ids: 0: 16 1: 28 2: 12 3: 35 4: 10751 5: 14 和 other 包含一 ...
[英]Add Search functionality using a input search field state in ReactJS
我制作了一個 ReactJS 應用程序,通過使用 API 來顯示餐廳菜單中的項目。 我的API數據是這樣的: 因此,為了顯示我的 API 中的上述數據,我以這種方式使用了 map function 現在我嘗試添加一個帶有 state 的輸入搜索框來過濾頁面上的項目列表 state: 搜索輸入: 后 ...
[英]reduce and map: how to get the same results
我正在使用reduce並且我的代碼工作正常,但是,我正在嘗試使用map ,但不確定如何實現它。 任何幫助,將不勝感激。 該程序有什么作用? 下面我從 API 獲取許多 ID 的數據(這些是角色 ID),然后獲取與人類特征相關的特征(一個特征可以有很多特征)並過濾掉null特征,因為我不想要這些特征, ...
[英]Function scatter_mapbox returns only blank maps. How to solve it?
我正在嘗試使用 plotly.express 中的函數“scatter_mapbox”,我得到的所有內容都是空白地圖。 我在使用 Python 3.9.12 的 Jupyter Notebook 中遇到了這個問題。 我曾嘗試使用其他函數(例如“line_geo”)生成地圖並取得成功,但如果我能讓此 ...
[英]python, map for function with arguments
我正在嘗試做這樣的事情: 其中 current_comb 是一個列表,我想將其插入到另一個列表梳中,並初步散列了它的元素所以我的目的是應用帶有參數(“???”)的地圖函數/想知道是否有任何方法可以使用地圖函數來做到這一點。 ...
[英]Save csv files using filenames in a map function loop
我正在使用 map function 在一個文件夾中循環一些 csv 文件。我想使用 csv 的名稱的切片版本來保存循環的結果。但是在嘗試將結果保存到 csv 時出現錯誤.這是我的代碼 錯誤: ...
[英]How to convert this loop to a map?
我怎么能用 map 得到相同的結果? 我是一個初學者,試圖了解地圖與迭代的關系。 是否可以將此循環放入 map? ...
[英]map function is not display anything
該代碼與單鏈表有關,我試圖在 React js 中使用 map function 和 state 顯示單鏈表的值。 function 邏輯()是在單擊顯示按鈕時更新 state,鏈接列表中的所有值都存儲在一個數組中,它更新 state listdata 但問題是當單擊顯示按鈕時 map funct ...
[英]Cannot reach datas details with map function
大家好,我對 map function 有疑問。我正在從我的 graphql 獲取數據,但是當我試圖在我的 console.log 中獲取它們時,我只能看到未定義。 先感謝您 ...
[英]attempt to change value in object in nested loop in react but i have issue
我有一個反應問題,我有 object 個問題 [{question, correctAnswer, options: [{id, answer, isSelected: false}]}] 我試圖在用戶選擇時將 isSelected 值更改為 true回答 map function 但它只返回一個選 ...
[英]How to access data in an array in order to call an API?
我需要從 API 的響應(在結果內)訪問數組內的數據,因為我需要那里的 ID 值來調用另一個 API。我的代碼中可能有什么錯誤顯示錯誤? 這是 API 的響應中的 object。 ...
[英]How to clean up this code by using for, forEach or map()?
這是我在 stackOverFlow 的第一個問題。 https://www.techiesys.in/websites/surya/shop-single.html 請在此處查看演示。 代碼運行良好,我知道我編碼最差。 我將把代碼片段放在這里。 const changeItem1 = doc ...
[英]react native- how to add items separately when item is onpressed
我已經能夠在 onPress 中添加項目,但它只顯示按下的項目。 我希望它在下面的視圖中連續顯示所有選定的項目。 const onPress =(item)=>{ setText(<Text style={{textAlign:"center"}}>{item}); 控制台日志( ...
[英]Where did the "None"s come from? | Python map() function
我寫了一個使用 map() function 的小代碼: 它應該返回提供的每個偶數,如果它是奇數,我不希望它返回任何東西,所以我輸入“通過”。 但是,當我運行它時,output 是這樣的: {2, 6, 無} 這很奇怪,我不確定“None”來自哪里,當我更改用於將 X 打印到 list() 或 ...
[英]How to change .map function order (asc & desc) in javascript?
我在 Spotify 中總共有 25 首歌曲列表,將來可能會增加。 像 1, 2, 3, 4 ..... 25. 在我的例子中,map() function 只顯示前 10 首歌曲(1 到 10)。 當一首新歌添加到我的播放列表中時,它會從第 26 個數字(如 26、27、28 ...... n ...
[英]How to fix Data.map is not a function in Reactjs?
所以我有一個 Notesdata 數組,其中包含 object 和屬性標題、標語、描述。 Notesdata array is stored in the "data" state variable in the App component and I am sending this data ...