As above, I want to change the highest value by row in the data frame to 1 and the remaining value to 0. What should I do?
https://stackoverflow.com/a/50536854/100093
m = np.zeros_like(df.values) m[np.arange(len(df)), df.values.argmax(1)] = 1 df1 = pd.DataFrame(m, columns = df.columns).astype(int)
981 In Java servlet, when SHA-256 sends WW-Authenticate header for digest authentication, the client does not return the result.
549 PHP ssh2_scp_send fails to send files as intended
712 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
548 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
542 Unable to install versioned in Google Colab
© 2024 OneMinuteCode. All rights reserved.