Questions tagged [python-3.x]
The python-3.x tag has no usage guidance.
239
questions
1
vote
0
answers
14
views
Can the k-index in either of the two individual locations be used to predict the estimated kp-index?
The k-index measures the condition of the magnetosphere. It is usually averaged over three hour, so each day has 8 measurements.
The planetary k-index (kp-index) is an average of the measures taken ...
0
votes
1
answer
64
views
Neural Network for binary classification not working
I have made a neural network that was working correctly as a multi-class classifier, but after changing the loss and the activation function, plus the output layer to just 1 neuron, it is not working ...
0
votes
0
answers
53
views
0
votes
0
answers
44
views
2060 Illegal instruction (core dumped) when importing Tensorflow in Python 3.8.18
I am attempting to run the experiments found here: https://github.com/risingfbk/p4ddle/tree/main/p4-ddos/p4ddle
However when I run the line:
./experiment_**.sh
I ...
1
vote
0
answers
10
views
NameError (solidity, brownie, python)
I'm writing a deploy script in Python (below) to deploy a smart contract using Brownie. When I compile I get an error that MockV3Aggregator is not defined. I have already created a file called ...
0
votes
0
answers
30
views
problems trying to install PIP
Ugh I'm so frustrated. I'm trying to install pip for vscode so I can get py-solc-x. I downloaded python (it shows that I'm on python 3.10.12 when i run python --version). But when I run install ...
0
votes
1
answer
26
views
Very basic python question [closed]
I am doing the free interactive learn python tutorial, and I am on the first conditions lesson. The task was to make it so that every statement in the following code resolved true. The code below was ...
0
votes
0
answers
15
views
Visualizing three parameters dataset, in which parameters are sub-group of one another
I am trying to represent air quality for zones within a city. Initially, based on various factors zones were classified into four exposure categories (1,2,3,4).Those four categories were further sub-...
0
votes
0
answers
22
views
How to generate synthetic data samples of Raman Spectroscopy by using GAN?
I am working on the Raman Spectroscopy dataset. The wavenumber/frequency range used by Raman spectra starts from 151.25 and ends at 1999.17. These values are used on the x-axis. While amplitude/...
1
vote
2
answers
390
views
Why am I getting this TypeError: quantile() got an unexpected keyword argument 'numeric_only' for pandas quantile()?
I ran into a weird error with pandas quantile() (pandas.DataFrame.quantile()) method. I have a dataframe with both numeric and non-numeric columns. I wanted to ...
0
votes
0
answers
41
views
Tensorflow loss: 0.0000e+00 - accuracy: 0.0000e+00
I was making changes to improve myself in a chatbot code using LSTM. But Loss and truth values are getting ridiculous values.
Code:
...
0
votes
0
answers
21
views
Using images with 5 or more channel in a tf.data pipeline
I have a data generator used to train FCNs (eg Unets) that uses tf.data. The image parser followed by the creation of the tf.data dataset for the training images looks like:
...
0
votes
1
answer
40
views
Plot Clustered Data by kmeans with colors for clusters and shapes for external labels
I wrote some Python code that uses the output from a principal component analysis to perform k-means on. The output to my script below is
Cluster 1: Data Points: [[ 1.87192346 -1.12568277] [ 1....
1
vote
0
answers
49
views
Highlight specific paragraphs from documents
I have a bunch of documents in which I want to highlight certain paragraphs/keyphrases. I have a list of the most frequently appearing sentences and I want to search for these paragraphs/keyphrases in ...
1
vote
0
answers
37
views
ML with Python - extract information from user text
I'm a web developer, got a little experience with Python but none on ML.
Tour operator customer want to introduce AI/ML on his website, the goal is to have a single text input where user can prompt ...
0
votes
1
answer
43
views
What are the approaches for extracting an injury and its description from a paragraph?
Suppose I have a paragraph which explains the injuries and its descriptions. I want to extract the injuries and its corresponding descriptions from the text. How can I do that?
For example, the ...
3
votes
1
answer
498
views
Sentence tokenization for sentence without punctuation
I wish to perform sentence tokenization for sentence without punctuation, below is the code:
...
0
votes
0
answers
7
views
input shape in ASR training
Sorry for stupid question but can someone say what is the shape of input batch in ASR training? Because as I understood, if we work with spectrogram we got something like
...
0
votes
0
answers
28
views
Implementing efficient "Customers who viewed this, also bought that" recommendation algorithm
I'm not sure how to formulate this but I'll have a go. This code should be completely reproducible given the data below. I hope I've been clear in my question.
I'm trying to implement a recommendation ...
0
votes
0
answers
13
views
Python frameworks to write an application with this architecture in azure
I'm renting an azure vm with 2vcpu with 2gb each (F2s or F2s v2) to implement an application with the following structure:
Db1 (run every 2 hr) --- if trigger (and less than 3 confirmations from this ...
0
votes
0
answers
21
views
get market cap from nseindia.com for given symbol list python way
get market cap from nseindia.com for given symbol list python way
https://www.nseindia.com/get-quotes/equity?symbol=RELIANCE**strong text**
Trade Information|
Total Market Cap (₹ Lakhs): 15,77,02,517....
0
votes
0
answers
539
views
lightgbm issue ValueError: Input numpy.ndarray or list must be 2 dimensional
Problem
Build prediction accuracy model using lightgbm on New York Taxi Duration dataset. Problem is "ValueError: Input numpy.ndarray or list must be 2 dimensional" with lightgbm.predict() ...
0
votes
0
answers
397
views
Sklean :: NotOneValueFound: Expected one value, found 0 Why is existing working code now broker with Sklearn 1.2.2?
Sklean Problem
What is the compiler complaining regarding 'A task has failed to un-serialize'?
Entire new models to be defined for OneVsRestClassifier and OneVsOneClassifier. Planning to test my SVC ...
0
votes
2
answers
75
views
Group rows partially [Python] [Pandas]
Good morning everyone.
I have the following data:
...
0
votes
0
answers
142
views
how to change path of a copied venv to the new directory
How can I change the original path of a venv (created by Pycharm for python 3.9) when I copy that venv to another directory in Windows?
I copied a venv created in a Pycharm Python project to another ...
0
votes
0
answers
182
views
show data values of scatter plot in Pycharm
How can I make Pycharm to show plotted data point values?
I want to show data point values that are plotted using pyplot library. I created a code below that creates annotation objects and implements ...
0
votes
0
answers
226
views
How to make the model fitting to the inverse-square law in Python?
I am studying basics of physics. I would like to learn to make a graphical solution to the following problem:
In a class room a lighting meter was used to measure the illuminance E at the distance r. ...
0
votes
1
answer
58
views
Change the shape of numpy array
My numpy array has the shape of (99,2) basically it has 2 columns one is the word and the other is a hot encoding vector size of 300 I want to delete the column of words and want to have only encoding ...
0
votes
0
answers
269
views
Input 0 of layer "Conv1" is incompatible with the layer: expected min_ndim=4, found ndim=3. Full shape received: (3, 256, 256)
import sys
import SimpleITK as sitk
from scipy import ndimage
import numpy as np
import os
import matplotlib.pyplot as plt
import tensorflow as tf
import ...
0
votes
0
answers
41
views
Memory Error when loading a txt file for an ML model
I am trying to run the Python code below:
...
0
votes
0
answers
31
views
How does a RL algorithm perceives OHLC data?
I'm creating a custom environment for RL trading.
I created a dict action space composed by 1 box and 2 discrete
variables.
I was thinking about "rendering" the ohlc data in the box, but ...
0
votes
0
answers
724
views
how to define a multidiscrete action space
I want to define a Multi Discrete action space for Reinforcement Learning, gym style and Stable Baselines compatible (A2C, PPO) with the following structure :
...
1
vote
1
answer
236
views
How to find correlation between features and labels when features are unordered words?
I have a data set with ~ 85 labels and a target (house price)
I wish to explore the correlation between the labels and the effect it has on the target.
I have some features that number and others that ...
0
votes
1
answer
3k
views
select rows containing max value basing on another duplicated rows of a group
I want to select rows by the maximum values of another column which would be the duplicated rows containing duplicated maximum values of a group.
This should contain three steps:
(1) group dataframe ...
1
vote
0
answers
46
views
Deep learning through backpropagation: not learning
I am starting with deep learning and decided to code a backpropagation algorithm on Python 3. I have followed many tutorials and have taken as example many programs that work. Yet, for some reason, my ...
0
votes
0
answers
92
views
identify data type of column from table using NER models
I have structure data with csv or parquet format, I would like to extract the data type of the column by analyzing the data.
when I looked at the NER from Hugging phase transformers, it actually ...
0
votes
0
answers
24
views
Good network for binomial classification of continuous and categorical dataset
I have a continuous variable from which I want to predict 1 simple event, to increase my odds, I created more 2 continuous variables that combined make the main variable and a lot of dummy vars.
...
0
votes
0
answers
250
views
How to build stock portfolio using deep reinforcement learning in Python by taking care of indicators for each given stock?
I have this Python code from this tutorial which is trading a stock (e.g. GME but it can be any) by taking care of its indicators ('SMA', 'RSI', 'OBV').
...
0
votes
3
answers
473
views
Tweak machine learning algorithm in SciKit to optimize for recall
I am given a dataset to detect fraud. Something similar like this:
https://www.kaggle.com/code/imgremlin/4th-place-in-fraud-detection-from-zindi
The issue with SciKit machine learning algorithm is ...
0
votes
1
answer
307
views
Cumsum starting value not 0 in Pandas
I have the following dataframe df of athletes (indexed by Athlete_ID) and their Rank (indexed by ...
0
votes
1
answer
429
views
OpenCV isn't processing all the images in a directory
I'm really trying to apply CLAHE to a directory of about 700 images. However, once I manage to get it running, for some reason the code stops before all the images are processed.
When I run it on ...
1
vote
2
answers
765
views
Average number of records by ID
I have a dataframe with IDs and booking refs, looking like the simplified example below.
ID
BookingRef
001
2019/32323
002
2011/23232
002
2017/7u4922
In the above example, 001 has one booking and ...
-1
votes
1
answer
137
views
Removing rows with total number of ID occurred not equal to a specific number in Pandas Python [closed]
I have the following data frame in Pandas:
...
0
votes
1
answer
2k
views
How to fine tune n_components parameter in UMAP?
I am using UMAP for clustering. However I can't find any information about methods to fine tune n_components parameter (which is very important). As good as I understand I can't use explained variance ...
2
votes
1
answer
608
views
PCA followed by UMAP then go into Random Forest
Is it a valid procedure to apply PCA to your dataset and then apply UMAP clustering on the PCA data, before sending the embedded cluster data to a Random Forest classifier?
Summary of process:
...
1
vote
1
answer
26
views
How to stop deep learning speech model to not recognize stranger voice?
I am trying to figure it out. But I can't find any solution. My model accuracy is 99% and my testing accuracy is 98%
I am using softmax for multiclass classification and adam optimizer to reach its ...
0
votes
1
answer
81
views
All Categorical data
I need some feedback on a problem I have been working on. I am working with a fairly balanced dataset with all categorical features, and a categorical outcome (classification problem). The data has no ...
0
votes
0
answers
39
views
How to Approach Linear Machine-Learning Model When Input Variables are Inconsistent
Disclaimer: I'm relatively new to the data science and ML world -- still trying to get a firm grasp on the fundamentals.
I'm trying to overcome a regression challenge involving a large, multi-...
0
votes
0
answers
1k
views
0
votes
2
answers
2k
views
Create new rows based on a value in a column
My dateset is generated like the example
df = {'event':['A','B','C','D'],
'budget':['123','433','1000','1299'],
'duration_days':['6','3','4','2']}
I need ...