Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 15431

Pandasonic way to combine multiple columns with expected format

$
0
0

There's a dataframe X with "Year", "Month" and "Day" as integer below,

  Year Month Day A B C ...0 2020    10  10 ...1 2021     1   1 ...2 2022     1  10 ...3 2023    10   1 ......

There's another dataframe Y with "Date" as string to be transformed from X, while other columns keep intact. The format is expected to be "YYYY-MM-DD".

  Date       A B C ...0 2020-10-10 ...1 2021-01-01 ...2 2022-01-10 ...3 2023-10-01 ......

What's the Pandasonic way to make it through, ideally in 1liner ?


Viewing all articles
Browse latest Browse all 15431

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>