289,231 questions
2
votes
2
answers
60
views
Multiindexed Pandas Series to Yes/No table [duplicate]
I have a MultiIndex table as follows
Index0 Index1 Variable
A 0 "a"
A 1 "x"
A 2 "t"
B 0 "x"
B 1 ...
-1
votes
0
answers
54
views
Error when running the command python -m pip install -ve . --no-build-isolation --config-settings editable-verbose=true
When I run this command on the virtual environment it gives this error.
ninja: error: pandas/_libs/ops_dispatch.cp312-win_amd64.pyd.p/pandas/_libs/ops_dispatch.pyx.c.dep: no outputs declared
...
-1
votes
0
answers
35
views
Using Pandas as an ATE logger [closed]
I'm writing some automated electrical tests for a piece of equipment and am trying to figure out a good way to continuously display the data to the user.
The program will perform ~50 tests each with a ...
Best practices
1
vote
2
replies
51
views
How to merge pandas dataframes with MultiIndexes on the columns
I am trying to merge two pandas dataframes together that have a MultiIndex on the columns. This works as expected when there are no duplicate columns, however when there are duplicate columns, it ...
0
votes
0
answers
19
views
Forecasting : FB Prophet function doesn't start from last datapoint in python
I've noticed that Facebook's Prophet function does a good job with forecasting. However, for my data, it never starts at the last value of y-predict. As you can see in the image, the last value of ...
1
vote
1
answer
97
views
Pandas not adding double quotes on insert statement causing issues in Oracle
I'm trying to read a csv file and write to an oracle database table.
The csv file looks like this:
"id_field","last_updated_date"
"123456",2021-08-07 16:26:45.299
The ...
2
votes
1
answer
69
views
Utilizing a loop or automated approach to join all possible elements in one dataframes together based on defined criteria
Summary: I want to be able to recreate my SQL code via Python such that I dont have to manually type out each join for situations when the combinations get too large to handle
I have one table
import ...
3
votes
1
answer
43
views
GreatExpectations; ExpectColumnValuesToBeIncreasing; '>=' not supported between instances of 'Timedelta' and 'int'
I try to load many different csv files and data check them with GreatExpecatations. It works for ExpectColumnValuesToNotBeNull, ExpectColumnValuesToBeUnique and ExpectColumnValuesToMatchRegex. But ...
Best practices
1
vote
2
replies
75
views
Compare DataFrames by headers vs using merge
I’m new to pandas and dataframes and am trying to understand two approaches:
Firstly, the setup:
import pandas as pd
# Example DataFrames
df1 = pd.DataFrame({
'id': [1, 2, 3],
'name': ['Alice'...
-2
votes
1
answer
50
views
How to fill missing values in a pandas DataFrame with the most frequent value of each group? [closed]
I have a pandas DataFrame with a 'toy' and 'color' column, which includes missing color values. I want to fill these NaNs with the most frequent color for their corresponding 'toy' type.
import pandas ...
0
votes
1
answer
71
views
How do I sort a Pandas DataFrame using a column name stored in a variable?
I am working with a Pandas DataFrame containing student data (GRE scores, TOEFL scores, etc.). I need to sort this DataFrame based on a specific column, but the column name is provided by the user as ...
3
votes
4
answers
146
views
Convert this date/time format into pandas datetime
I downloaded some data from a data repository to do some analysis, and it is in a format that I have never seen and do not know how to work with.
import pandas as pd
raw={
'Fill':['text','','','...
-1
votes
1
answer
88
views
Put all row from a data in a list
I am having a problem to put an entire row from data in a list
import pandas as pd
import numpy as np
import csv
df= pd.read_csv ("data.csv")
my_list = [] # list
for n in range(1, ...
0
votes
0
answers
93
views
Suitable Pandas installation on 32-bit Python (3.10, 3.11)
I am trying to use the Kiwoom OpenAPI (for making automated stock trading program), which requires a 32-bit Python environment. However, to successfully use Kiwoom Open API I need to set up pandas in ...
2
votes
3
answers
130
views
How to modify mulitple columns applying if else to multiple pandas dataframe columns
I have a dataFrame with columns Age, Salary and others, if I used:
df['Age'] = df['Age'].apply(lambda x : x+100 if x>30 else 0)
Then I can modify the Age column with the if else condition. Also, if ...