Skip to content

How prevent Ruff to format dictionary into single line ? #14792

Answered by MichaReiser
laguill asked this question in Q&A
Discussion options

You must be logged in to vote

You can add a trailing comma to the last dictionary entry to keep it on separate lines

summary_data = []
for name, df in dfs.items():
    summary_data.append(
        {
        "Fichier": name,
        "Dimensions": df.shape,
        "Noms colonnes": df.columns.tolist(),
        "Types de données": df.dtypes,
        }
    )

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@laguill
Comment options

Answer selected by laguill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants