All Questions
21,244
questions
0
votes
0
answers
15
views
num_samples = set(int(i.shape[0]) for i in tree.flatten(data)) IndexError: tuple index out of range (Tensorflow)
When trying to train an Tensorflow LSTM I am getting the following error:
File "C:\Users\user\Documents\LSTM_Volatility.py", line 66, in <module>
model.fit(x_train , ...
0
votes
1
answer
32
views
Pandas apply is turning matrices into nan/None
I am running the following code on a dataset trying to tally the rows from one data set that match a varied set of criteria. I am using the apply function to store this tally inside of a matrix, where ...
0
votes
1
answer
48
views
How to combine type hint using bound type variable and static types for maximum flexibility?
I would like to add type hints to a simple function. Since it internally only uses numpy calls, it is very flexible with its inputs. Basically, it accepts all array-like objects, for which there is ...
0
votes
1
answer
45
views
Issue with Custom Rounding Function in Python Pandas
I have implemented a custom rounding function in Python using Pandas, but it's not producing the expected results in certain cases. It basically should always round down to the nearest step.Here's the ...
0
votes
1
answer
44
views
What is the meaning of: Pandas data cast to numpy dtype of object. Check input data with np.asarray(data) and how can be solved?
I'm trying to model a time series for a stock price with the following code:
import opendatasets as od
import numpy as np
import pandas as pd
import plotly.graph_objects as go
from plotly.subplots ...
0
votes
0
answers
20
views
read parquet file in dask and convert them to correct numpy shape
I am reading a parquet file in dask and trying to reshape it to how I want it, but it seems rather impossible (I am quite new to dask too).
So, I have a parquet file which has some 8M x 384d numpy ...
1
vote
1
answer
59
views
Panda's value_counts() method counting missing values inconsistently
Please consider this simple dataframe:
df = pd.DataFrame({'x': [1, 2, 3, 4, 10]}, index = range(5))
df:
x
0 1
1 2
2 3
3 4
4 10
Some indices:
ff_idx = [1, 2]
sd_idx= [3, 4]
One way of ...
0
votes
0
answers
15
views
Python flask application is not working properly on Apache 24 in windows
I am using Python 3.8.10 with Apache(2.4.59) and mod_wsgi(4.9.4)on windows10. When running my application, the API requests go into a pending state. After troubleshooting with print statements, I ...
0
votes
0
answers
19
views
Synthetic Data Vault MultiTableMetadata and get_column_pair_plot
I need help about using get_column_pair_plot because I have difficulty on understanding how to use MultiTableMetadata. Consider the following data :
import numpy as np
import pandas as pd
from sdv....
1
vote
0
answers
74
views
Optimize loops in Numpy correlation matrices
I have a piece of code to calculate price sensitivity based on the product and its rating.
Below is the original data set with product type, reported year, customer’s rating, price per unit, and ...
0
votes
0
answers
75
views
Add new rows to dataset in nested for loop
The following script works when data4 is used to create dataframe, hours_date_match_barc. It breaks when I want to use data3 and I believe it is because it is not able to add more rows to out.
...
2
votes
0
answers
51
views
How can I calculate Pearson Correlation in a memory-efficient way using Pandas?
I am building a simple user-based recommendation system using 10M MovieLens dataset. While calculating the Pearson Correlation, the enormous size of the data (69878 row, 10677 cols) overwhelms my ...
-2
votes
0
answers
56
views
Most efficient way to compare \ work with filtered Series / Dataframe rows
When I'create filtered Series or Dataframe object I get filtered indices too:
not_na_prices:pd.Dataframe = price[(price["price1"].notna()) & (price["price2"].notna())]
print(...
1
vote
0
answers
84
views
Python Iterating over Numpy Tile and for-loops
Goal: Here is a sample of a dataset that has "ID", "PHASENAME", "CDAYS", "MULTI_FACTOR", "DAY_COUNTER", and "DAILY_LABOR_PERCENT". I was ...
0
votes
2
answers
34
views
Convert pint-panda dataframe to numpy
I have a large dataframe (>30 000 rows and > 500 columns), I am using pint to convert from one unit to another using the pint-panda option then I wish to write the dataframe to a text file. I ...