Python Forum
Structuring and pivoting corrupted dataframe in pandas
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Structuring and pivoting corrupted dataframe in pandas
#3
(Sep-18-2021, 01:11 PM)snippsat Wrote: You have same key name in dictionary then there will be a collisions where only one survive 🚑
Look like a simple name change will give output wanted example NoteBook

Oh it was misspelling thing. While i was reproducing the dataframes for people to try it I unintentionally wrote countryName twice. So the right one would be provinceName as the screenshots of whatIHave and whatINeed describes.

But the problem is not related to that. I need to replicate the countryName, provinceName, productID, productName column values through below. Then I need to add varied dateID and productPrice values next to them like the second screenshot.

How can I achieve this?
Reply


Messages In This Thread
RE: Structuring and pivoting corrupted dataframe in pandas - by gunner1905 - Sep-18-2021, 01:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Photo Converting Pandas DataFrame to a table of hourly blocks Abedin 1 699 Apr-24-2025, 01:05 PM
Last Post: snippsat
  Most efficient way to roll through a pandas dataframe? sawtooth500 2 1,260 Aug-28-2024, 10:08 AM
Last Post: Alice12
  docx file to pandas dataframe/excel iitip92 1 3,084 Jun-27-2024, 05:28 AM
Last Post: Pedroski55
  Python Alteryx QS-Passing pandas dataframe column inside SQL query where condition sanky1990 0 1,469 Dec-04-2023, 09:48 PM
Last Post: sanky1990
  Downloaded file corrupted emont 5 3,167 Oct-01-2023, 11:32 AM
Last Post: snippsat
  Question on pandas.dataframe merging two colums shomikc 4 2,101 Jun-29-2023, 11:30 AM
Last Post: snippsat
  Structuring a large class: privite vs public methods 6hearts 3 2,026 May-05-2023, 10:06 AM
Last Post: Gribouillis
  Pandas AttributeError: 'DataFrame' object has no attribute 'concat' Sameer33 5 10,781 Feb-17-2023, 06:01 PM
Last Post: Sameer33
  help how to get size of pandas dataframe into MB\GB mg24 1 5,689 Jan-28-2023, 01:23 PM
Last Post: snippsat
  pandas dataframe into csv .... exponent issue mg24 10 5,457 Jan-20-2023, 08:15 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020