The Python Oracle

How to add multiple columns to pandas dataframe in one assignment?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 3

--

Chapters
00:00 Question
00:33 Accepted answer (Score 372)
03:50 Answer 2 (Score 56)
04:12 Answer 3 (Score 23)
05:14 Answer 4 (Score 15)
06:00 Thank you

--

Full question
https://stackoverflow.com/questions/3905...

Accepted answer links:
[before Python 3.6 or 3.7]: https://stackoverflow.com/q/39980323/383...
https://stackoverflow.com/a/44951376/383...
[Add multiple columns to DataFrame and set them equal to an existing column]: https://stackoverflow.com/q/43415798/383...
[Is it possible to add several columns at once to a pandas DataFrame?]: https://stackoverflow.com/q/19866377/383...
[Add multiple empty columns to pandas DataFrame]: https://stackoverflow.com/q/30926670/383...

Answer 4 links:
[concat]: http://pandas.pydata.org/pandas-docs/sta...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #pandas #dataframe

#avk47