Skip to content
Advertisement

Tag: pandas

How to convert csv to complex json

How to do this stuff in python pandas? I am trying to make put request to some API and not sure how to generate request body since I have the csv file only . Request body asks for fixed set of schema Answer Dataframe has a function to_dict.

Pandas: Apply rolling window on complex function (Hurst Exponent)

In a nutshell: I need to calculate the Hurst Exponent (HE) across a rolling window inside a pandas dataframe and assign the values to its own column. The HE function I use was lifted from here as it seemed more robust. For convenience it’s posted below: Now in order to test the function let’s grab some TSLA data from Yahoo

Pandas : DataFrame columns are not unique when making dictionary

I have a dataframe like this: Name Alt_01 Alt_02 AAPL Apple apple Inc. AMZN Amazon NaN in order to check if string contains alt names, I build code like: Since not all the names have same amount of alternative names, I put dropna() function to remove NaN values. But after I do this, I receive message like: UserWarning: DataFrame columns

Heatmap using pandas dataframe

I have a data frame with the following rows: etc. I want a heatmap of the disease names (IHD, CM, etc) on the X axis with the protein name on the y=axis. I’m running into a float issue since the protein column is in letters. On my heatmap, I want the protein name to show though, so it wouldn’t be

Advertisement