Category "pandas"

Why does pandas.json_normalize(json_results) raise a NotImplementedError?

I have a json variable named json_results and I am running pandas.json_normalize(json_results). It raises the following error: in _json_normalize raise NotI

Save image with fig.write_image in Python Plotly

I would like to save images within plotly fig.write_image using a forloop, where each image name include a customised id and Timestamp value with a string forma

median in pandas dropping center value

I am working in pandas and want to implement an algorithm that requires I assess a modified centered median on a window, but omitting the middle value. So for i

Having coding line graphs after iloc command line

I'm trying to graph a line with the x- axis being the hour to the sum of 24 hours and the y axis being the sums of the first 4 .15 min increments of kWh values.

How do I change the values in a pandas column that are selected by a regex?

I'm cleaning up data for a personal project and am standardizing the large number of categories. The seemingly low hanging fruit have similar enough names such

how to get smallest index in dataframe after using groupby

If create_date field does not correspond to period between from_date and to_date, I want to extract only the large index records using group by 'indicator' and

Printing values in new columns based on a condition from another column

I have a following dataframe: Time Tab User Description 27.10.2021 15:58:00 Tab Alpha [email protected] Tab Alpha of type PARTSTUDIO opened by User A 27.10.2021

Comparing two panda dataframes with different size

I want to compare two dataframes with content of 1s and 0s. I run for loops to check every element of the dataframes and at the end, I want to replace the "1" v

Can I store a Parquet file with a dictionary column having mixed types in their values?

I am trying to store a Python Pandas DataFrame as a Parquet file, but I am experiencing some issues. One of the columns of my Pandas DF contains dictionaries as

How to reset cumulative sum every time there is a NaN in a pandas dataframe?

If I have a Pandas data frame like this: 1 2 3 4 5 6 7 1 NaN 1 1 1 NaN 1 1 2 NaN NaN 1 1 1 1 1 3 NaN NaN NaN 1 NaN

How to use Python faker for dependent columns

Scenario If column1 = ‘Value’ then column2 = ‘AAA’ How can we use faker to generate mock data for these dependent columns. Need to consi

Show Pandas Dataframe in for loop

I have a for-loop in which I build a pandas dataframe and everytime the loop starts over, the dataframe is updated. What I would like to do is to depict this ta

Sort pandas dataframe in very special order

I want to do a very special order in pandas dataframe. I have two separated dataframes: dataframe a and dataframe with different sizes. Example: dataframe a si

Trying to rename repeated columns in pandas DataFrame

I have a list of duplicate columns in my DataFrame (named as df here in the code) and I am trying to rename duplicate columns by adding a number in the end. For

How to convert road lane coordinates to tensors in Python?

I am trying to develop a Lane Detector using PyTorch. Basically, I'm reading the video frame by frame using cv2, then finding edges using Canny Edge Detector an

Datetime + String from a Pandas table into a new table. One line of code

I'm a beginner at python. I'm moving specific cells/scalars from one Dataframe to another. I'm trying to work out why my first block of code didn't work but my

Where is pandas.tools?

After installing pandas: idf:~/Documents/python/plot$ pip3 install pandas --user Collecting pandas Using cached https://files.pythonhosted.org/packages/f9/e1

Saving Pandas dataframe to SharePoint location as csv file

I want to save my transformed dataset to csv on SharePoint location. Can anyone help with how to approach. I have gone through Libraries shareplum but they read

Apply column name to row values unless nan or null

I'm attempting to add the column name of a dataframe to each row containing a non null value. A sample data set I am working with is: ID County Other

Read csv from Azure blob Storage and store in a DataFrame

I'm trying to read multiple CSV files from blob storage using python. The code that I'm using is: blob_service_client = BlobServiceClient.from_connection_string