Category "pandas"

How to add new edges to the stellargraph dataset?

I need to add some extra edges to Cora dataset using stellargraph. Is there ane way to add edges to the current dataset in stellargraph library? import stellarg

Convert Sharepoint List into Pandas Dataframe

I have a table in Sharepoint that I'm wanting to convert into a Pandas Dataframe. I've largely used this question to try and frame a solution Get SharePoint Lis

How to calculate bed mates and length of time spent together

I am working with some patient data in Pandas that looks roughly like the following patient_id room_id start_date end_date 1 1001 01-01-2022 04:30:26 05-01-202

How to hide text labels for rangeslider in Plotly?

I'm trying to plot a time-series plot with a range slider using Plotly in Python. import plotly.express as px import pandas as pd data = pd.read_csv('https://r

How to give space before and after on a pandas dataframe object?

I have a dataframe_ df date 13MAY2022 13MAY2022 13MAY2022 13MAY2022 How can we give space between these objects? My expectations like this_ df date

pandas check if there are duplicates of repeated values between the two columns and not inside one column

I have 2 columns and I want to check if there are duplicates of repeated values between the two columns and not inside one column. The length of the datasets is

Basic Trading strategy with python

I am trying to code a basic trading strategy call sell the winner and buy the loser. I have listed the three conditions I want to code in python. I am a newbie

Limit writing of pandas to_excel to 1 million rows per sheet

I have a dataFrame with around 28 millions rows (5 columns) and I'm struggling to write that to an excel, which is limited to 1,048,576 rows, I can't have that

Placeholder for DataFrame in pd.query

I use pd.query and pd.eval a lot. However, sometimes I find myself in situations where I would like to filter an unnamed DataFrame with pd.query and it would be

Issue when selecting desired elements from dict_keys in Python

I have a list of disctionary keys ['A_report1', 'A_report2', ..., 'A_report10','B_report1', 'B_report2', ..., 'B_report10',]. I want to extract all 'report1' fr

ValueError: 18 columns passed, passed data had 1 columnss

#pip install sqlalchemy #from Google import Create_Service # link to source code is in the description import pyodbc as odbc # pip install pypyodbc

Python SUMIF with one condition across dataframes

I'm working with two dataframes MRP: Material Description Septiembre 1208181 ADSV,NA,MX,ADH HOTMET 814433PM 630.2888856 1206500 SHWP,NA,MX,WRAP M-WRAP 18' 459.

How can I get last value of STOCHRSI with Ta-Lib?

I implemented it but it prints all. print(ta.STOCHRSI(df["close"], 14, 5, 3, 0)[-1]) 2022-04-20 17:00:00 NaN 2022-04-20 18:00:00 NaN 2022-04-

How to sample a python df on daily rate when it is greater than 500 yrs

I need to sample a dataframe that has a date range of 100 years at a daily rate because I want to get yearly totals (so I thought resample at daily rate then su

pandas df.to_parquet write to multiple smaller files

Is it possible to use Pandas' DataFrame.to_parquet functionality to split writing into multiple files of some approximate desired size? I have a very large Data

Replacing ID values of polygons in a geodataframe to values of polygons from another geodataframe

I have polygons inside another bigger single polygon and I want to be able to replace the ID values (for example) of the former polygon to that of the latter. S

Pandas: Sampling from a DataFrame according to a target distribution

I have a Pandas DataFrame containing a dataset D of instances which all have some continuous value x. x is distributed in a certain way, say uniform, could be a

Plotly chart is a mess of lines after index converted to pandas datetime

My plotly chart is just a mess of zig-zagging lines (see chart here). This only happens after I use df['Date'] = pd.to_datetime(df.index) to convert the index t

Convert pandas data frame column, which has values of vectors, into tensors

My question is how to convert a vector on pandas data frame into tensors. The data frame has a resume column which has a vector representations of each resume d

Write to an existing .xlsm using pandas and XlsxWriter

I would like to write a dataframe to an existing .xlsm file which already has content. Write pandas dataframe to xlsm file (Excel with Macros enabled) describes