Is it possible to end up with a categorical variable column after a melt operation in pandas? If I set up the data like this: import pandas as pd import numpy a
#here I have to apply the loop which can provide me the queries from excel for respective reports: df1 = pd.read_sql(SQLqueryB2, con=con1) df2 = pd.rea
I have a DataFrame with a Datetimeindex with non equidistant timestamps. I want to get the mean for each hour. But by using resample.mean(), the time distance b
I am able to compute the default rate in number (e.g, the percentage of customers falled into default), with the code below, getting the following output: impor
I'm trying to figure out how to add 3 months to a date in a Pandas dataframe, while keeping it in the date format, so I can use it to lookup a range. This is w
I have a dataframe with over 280 features. I ran correlation map to detect groups of features that are highly correlated: Now, I want to divide the features to
This is my original dataframe. This is my second dataframe containing one column. I want to add the column of second dataframe to the original dataframe at th
I have a data-frame df where the head looks like: identifier department organisation status change date 1 14 Finance
I currently have a gmap displaying gps points, however, I was hoping there was a way to colour code my GPS points based on which month they were recorded ? I ha
I want to load BigTable data into BigQuery with direct way. Till now I am loading BigTable data into CSV file using Python and then loading csv file into BigQue
When I try some codes in pandas, the bash code wget is used in colab as the following: import pandas as pd !wget abc.com/sales.csv If I want
In pandas I can search and replace all fields that contain the word fish, for example, using df.replace(r'.*fish.*', 'foo', regex = True). But how do I sear
I'm trying to convert a dataframe that has inside other dataframe like: { 'id': 3241234, 'data': { 'name':'carol', 'lastname': 'netfli
I merged 3 different CSV(D1,D2,D3) Netflow datasets and created one big dataset(df), and applied KMeans clustering to this dataset. To merge them I did not use
I am reading multiple JSON objects into one DataFrame. The problem is that some of the columns are lists. Also, the data is very big and because of that I canno
I'm converting a program of SAS code into a python equivalent. One section that i'm struggling with is how to convert a macro program in SAS when the variables
if u have a formulated excel file and now wants to append data frame by python then how.. I used this code but did not get output mypath="C:\\Users\\egoyrat\\
I was working in a pretty simple task: applying wide_to_long to a DataFrame, but every time I ran it, I got an empty DataFrame. I was almost sure I was doing it
My Goal is to read a .csv file from google drive and load it to a dataframe. I tried some answers here but the thing is, the file is not public and needs authen
I am new to python and I can't figure out why I get this error: ValueError: Incompatible indexer with Series. I am trying to add a date to my data frame. The da