Skip to content

Tag: pandas

Pandas Merge to Determine if Value exists

I have checklist form data coming into a spreadsheet that I am trying to determine if a specific value was not checked and provide info based off that. My first thought was to have a master list/df where all the form values are then do a left/right merge on each response to determine values that weren’t…

Convert Date to pandas from ISO 8601 format

I have a date it look like this how can i convert it to someting like this Answer If you want to do this using Pandas, you can use pandas to convert iso date to datetime object then strftime to convert timestamp into string format to apply it to a series of dates of DataFrame column you can replace iso_date

Read nested JSON in a cell with Pandas

I recovered a list of ISO 3166-2 countries and regions in this Github repository. I managed to have a first look of the regions using the following code: Which gives the following output: name divisions Afghanistan {‘AF-BDS’: ‘Badakhshān’, ‘AF-BDG’: ‘Bādghīs’, &…

Error with shape of passed value to pandas dataframe

I parsed a json object obtained from hidden api on website; after some trouble i get finally what i wanted but got an error creatinf the dataframe. Here’s the code: `The error i got is: “Shape of passed values is (13, 1), indices imply (13, 13)” In fact if i run for example odds1 i got this:…

Pandas sum of count per percentile of rows

Here is a link to a working example on Google Colaboratory. I have a dataset that represents the reviews (between 0.0 to 10.0) that users have left on various books. It looks like this: The first rows have 1 review while the last ones have thousands. I want to see the distribution of the reviews across the us…