id
stringlengths
7
11
source
stringclasses
1 value
category
stringclasses
11 values
title
stringlengths
15
214
text
stringlengths
70
30.5k
url
stringlengths
57
160
tags
stringlengths
3
113
created_at
int64
1.22B
1.79B
se_72747814
stackoverflow
DATA_SCIENCE
Building a Production-grade Data Science environment at home - Questions around orchestration
Building a Production-grade Data Science environment at home - Questions around orchestration I hope you can help me here. I am working on creating a small environment at home for Data Science. I am having trouble understanding how to create the orchestration layer properly (I am also not convinced that the other comp...
https://stackoverflow.com/questions/72747814/building-a-production-grade-data-science-environment-at-home-questions-around
docker, data-science, apache-nifi, production-environment, data-oriented-design
1,656,093,736
se_72105705
stackoverflow
DATA_SCIENCE
Using input to filter parsed csv through Dictreader
Using input to filter parsed csv through Dictreader I am new to python and my objective is to create a basic script capable of filtering a csv database through user input. I searched through various posts and answers and came up with this code that doesn't give the desired responses for some reason, can somebody tell ...
https://stackoverflow.com/questions/72105705/using-input-to-filter-parsed-csv-through-dictreader
python, csv, dictionary, data-science
1,651,613,721
se_74861755
stackoverflow
DATA_SCIENCE
How to get PDF structure in xml format
How to get PDF structure in xml format Below is my code, where I am converting pdf to xml format. But this gives me xml formated file only if I used XFA-PDF(pdf form) formated pdf. I need to convert any type of pdf to xml format and xml contain information about text value, tables, images, objects/drawings and their x...
https://stackoverflow.com/questions/74861755/how-to-get-pdf-structure-in-xml-format
python, python-3.x, xml, pdf, data-science
1,671,532,710
se_74923958
stackoverflow
DATA_SCIENCE
The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() I got this error The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() Let be x an array of continuous numerical values between 0 and 10 dts1['NewCol'] = np.apply_along_axis(getbool,axis=0...
https://stackoverflow.com/questions/74923958/the-truth-value-of-an-array-with-more-than-one-element-is-ambiguous-use-a-any
pandas, data-science, data-analysis, exploratory-data-analysis
1,672,088,592
se_74920203
stackoverflow
DATA_SCIENCE
Invalid classes inferred from unique values of `y`. Expected: [0 1], got ['N' 'Y']
Invalid classes inferred from unique values of `y`. Expected: [0 1], got ['N' 'Y'] Invalid classes inferred from unique values of `y`. Expected: [0 1], got ['N' 'Y'] anyone can help me out with this problem it is Xgboost problem i solve this with label encoding but for further steps i face problems
https://stackoverflow.com/questions/74920203/invalid-classes-inferred-from-unique-values-of-y-expected-0-1-got-n-y
data-science
1,672,057,074
se_74877847
stackoverflow
DATA_SCIENCE
Tokenize Review wise for sentiment analysis
Tokenize Review wise for sentiment analysis In this Amazon dataset I've Product_Description , Product_Type & Sentiment column where I want to build classification model. keeping Product_Description & Product_Type as X and Sentiment as Y. but i receive few error still not able to find the solution. I want the sentence ...
https://stackoverflow.com/questions/74877847/tokenize-review-wise-for-sentiment-analysis
nlp, data-science, sentiment-analysis, text-classification, tfidfvectorizer
1,671,634,341
se_74910517
stackoverflow
DATA_SCIENCE
Unable to understand graph data in R language
Unable to understand graph data in R language I was working on a task where I'm required to find if there is increase in price while increase in number of rooms. I've used ggplot2 and geom_point. But I'm unable to understand is there any increment. Could any one help to make me understand this graph please. Or is ther...
https://stackoverflow.com/questions/74910517/unable-to-understand-graph-data-in-r-language
r, ggplot2, graph, data-science, geom-point
1,671,918,946
se_74863870
stackoverflow
DATA_SCIENCE
Inconsistency between decision_function and predict methods in OvO SVC in Scikit learn package
Inconsistency between decision_function and predict methods in OvO SVC in Scikit learn package I have observed that there are differences in the implementation of the decision_function and the predict methods the one versus one multi class implementation of SVC in the sci-kit learn package. Is there a way to align thi...
https://stackoverflow.com/questions/74863870/inconsistency-between-decision-function-and-predict-methods-in-ovo-svc-in-scikit
python, scikit-learn, data-science, svm
1,671,543,052
se_74908128
stackoverflow
DATA_SCIENCE
When to use line=r and line=45 in qqplot
When to use line=r and line=45 in qqplot Can anyone tell me when do we use line='r'?? sm.qqplot(df['Delivery_time'], line='r') and when do we use line=45? sm.qqplot(df['Delivery_time'], line='45')
https://stackoverflow.com/questions/74908128/when-to-use-line-r-and-line-45-in-qqplot
python, data-science, statsmodels
1,671,890,378
se_74908952
stackoverflow
DATA_SCIENCE
Pandas calculating time deltas from index
Pandas calculating time deltas from index I have a months time series data that I am trying calculate total hours, minutes, seconds in the dataset as well as for a unique Boolean column for when the column is True or a 1. And for some reason I am doing something wrong where the total time calculations don't appear cor...
https://stackoverflow.com/questions/74908952/pandas-calculating-time-deltas-from-index
python, pandas, data-science, data-wrangling, data-scrubbing
1,671,899,492
se_74903336
stackoverflow
DATA_SCIENCE
i have a simple Error from my k-fold cross validation code for a logistic regression model Python
i have a simple Error from my k-fold cross validation code for a logistic regression model Python i have this error below from my code for a K-Fold cross validation "None of [Int64Index([ 0, 1, 3, 4, 5, 6, 7,\n 8, 9, 10,\n ...\n ...
https://stackoverflow.com/questions/74903336/i-have-a-simple-error-from-my-k-fold-cross-validation-code-for-a-logistic-regres
python, machine-learning, statistics, data-science, google-colaboratory
1,671,823,452
se_74906232
stackoverflow
DATA_SCIENCE
Found array with 0 sample(s) (shape=(0, 1)) while a minimum of 1 is required
Found array with 0 sample(s) (shape=(0, 1)) while a minimum of 1 is required This error keeps coming when I try to find MI values. My code is as follows X_new = X.copy() X_new = X_new.fillna(0) y = data.SalePrice def make_mi_scores(X, y): X = X.copy() for colname in X.select_dtypes(["object", "category"]): ...
https://stackoverflow.com/questions/74906232/found-array-with-0-samples-shape-0-1-while-a-minimum-of-1-is-required
python, machine-learning, scikit-learn, data-science, kaggle
1,671,867,564
se_74902506
stackoverflow
DATA_SCIENCE
Fine tuning a BERT Model as a chatbot giving error while training
Fine tuning a BERT Model as a chatbot giving error while training I have been trying to fine tune a BERT model to give response sentences like a character based on input sentences but I am getting a rather odd error every time . the code is ` Here sourcetexts is a list of sentences that give the context and target_tex...
https://stackoverflow.com/questions/74902506/fine-tuning-a-bert-model-as-a-chatbot-giving-error-while-training
machine-learning, deep-learning, nlp, data-science, fine-tuning
1,671,817,166
se_74901614
stackoverflow
DATA_SCIENCE
Calculate percentile with column values
Calculate percentile with column values first of all, in case I comment on any mistakes while writing this, sorry, English is not my first language. So I started to study data science and data visualization in sports with Python just for hobby, I'm a really begginer on this. I want to calculate the percentile of each ...
https://stackoverflow.com/questions/74901614/calculate-percentile-with-column-values
python, pandas, math, statistics, data-science
1,671,811,160
se_74866878
stackoverflow
DATA_SCIENCE
KeyError: 'Filter' (receiving specific data from dataframe)
KeyError: 'Filter' (receiving specific data from dataframe) So, the order is "Ask the user to enter the name of the object for which he/she wants to receive data and the names of the filters, data in which you need (it is possible to introduce several filters)." this is my data: Object HJD 24... Filter Mag...
https://stackoverflow.com/questions/74866878/keyerror-filter-receiving-specific-data-from-dataframe
python, pandas, dataset, data-science, src
1,671,557,983
se_34839318
stackoverflow
DATA_SCIENCE
Clustering nominal data
Clustering nominal data I am trying to apply a clustering algorithm to my data set. My data set is of movies, and some of the attributes are nominal. for example: movie 1: [ IMDB popularity: 1.02 Genre: Drama Sub-genre: Horror Rating: 1.23% ] movie 2: [ IMDB popularity: 2.08 Genre: Comedy Sub-genre: Animation Rating...
https://stackoverflow.com/questions/34839318/clustering-nominal-data
algorithm, data-science, cluster-analysis, nominal-data
1,453,040,091
se_74875388
stackoverflow
DATA_SCIENCE
How do I extract the text of a single page with PyPDF2?
How do I extract the text of a single page with PyPDF2? I have a document library which consists of several hundred PDF Documents. I am attempting to export the first page of each PDF document. Below is my script which extracts the page. It saves each page as an individual PDF. However, the files which are exported se...
https://stackoverflow.com/questions/74875388/how-do-i-extract-the-text-of-a-single-page-with-pypdf2
python, data-science, text-mining, pypdf
1,671,622,156
se_74896493
stackoverflow
DATA_SCIENCE
Python - Printing multiple arrays of randomly sampled elements from an original array
Python - Printing multiple arrays of randomly sampled elements from an original array I have an original array in python : t_array t_array=(['META' , 'AAPL' , 'AMZN' , 'NFLX' , 'GOOG' ]) sample = random.sample (t_array, 3) print=( 'sample') and got this : ['AAPL', 'AMZN', 'META'] Now when I run the (1) code again t...
https://stackoverflow.com/questions/74896493/python-printing-multiple-arrays-of-randomly-sampled-elements-from-an-original
python, pandas, data-science
1,671,774,166
se_73509591
stackoverflow
DATA_SCIENCE
How to split one excel into multiple excel with common number of rows distribution across all the new excel using Python?
How to split one excel into multiple excel with common number of rows distribution across all the new excel using Python? I have one excel with large data. I want to split this excel into multiple excel with equal distribution of rows. My current code is working partially as it is distributing required number of rows ...
https://stackoverflow.com/questions/73509591/how-to-split-one-excel-into-multiple-excel-with-common-number-of-rows-distributi
python, excel, pandas, dataframe, data-science
1,661,590,486
se_74894560
stackoverflow
DATA_SCIENCE
Simple linear regressions vs multiple linear regression model scaling
Simple linear regressions vs multiple linear regression model scaling I read somewhere suggesting that in case there are multiple features(multi linear model) no feature scaling is needed because co-efficient takes care of that. But for single feature(simple linear model); feature scaling is needed. Is this how python...
https://stackoverflow.com/questions/74894560/simple-linear-regressions-vs-multiple-linear-regression-model-scaling
python-3.x, machine-learning, data-science
1,671,749,056
se_74893906
stackoverflow
DATA_SCIENCE
pandas nested dict to flat dataframe
pandas nested dict to flat dataframe I have a dict: d = {12 : [8,2,3,4] 15 : [6,1,9,2]} I want to transform it to a flat dataframe: df = val 0 1 2 3 12 8 2 3 4 15 6 1 9 2 How can I do this?
https://stackoverflow.com/questions/74893906/pandas-nested-dict-to-flat-dataframe
python, pandas, dataframe, data-science
1,671,743,586
se_74892132
stackoverflow
DATA_SCIENCE
How to convert tibble data with various classes from long to wide format problem using ONLY base R package?
How to convert tibble data with various classes from long to wide format problem using ONLY base R package? I am trying to convert my dataset from long to wide format only using base R packages and dplyr only due to university's project requirements. I have tried to use reshape function, but I have encountered problem...
https://stackoverflow.com/questions/74892132/how-to-convert-tibble-data-with-various-classes-from-long-to-wide-format-problem
r, data-science, reshape, tibble
1,671,731,369
se_74887601
stackoverflow
DATA_SCIENCE
How to transform this plot in a right subplot?
How to transform this plot in a right subplot? I have to plot this by subplots, I have 4 features and i want to have 2 rows and 2 columns, how can i do that? cat_features = ['Gender', 'Customer Type', 'Type of Travel', 'Class', 'satisfaction'] f, axs = plt.subplots(2, len(cat_features[:-1]), figsize=(10, 4)) for ax, ...
https://stackoverflow.com/questions/74887601/how-to-transform-this-plot-in-a-right-subplot
python, matplotlib, seaborn, data-science, visualization
1,671,707,181
se_74888969
stackoverflow
DATA_SCIENCE
How to convert an ONNX model with dynamic input shape to Tensorflow model?
How to convert an ONNX model with dynamic input shape to Tensorflow model? I am trying to convert an ONNX model with a dynamic input shape to TensorFlow format using the onnx_tf package. I am using TensorFlow 2.11.0, ONNX 1.13.0, and onnx_tf 1.10.0. The input to the model contains 3 arrays: the data with dynamic shape...
https://stackoverflow.com/questions/74888969/how-to-convert-an-onnx-model-with-dynamic-input-shape-to-tensorflow-model
python, tensorflow, data-science, onnx
1,671,714,501
se_61742943
stackoverflow
DATA_SCIENCE
Is there any dataset available for similar posts recommendation like Facebook, Instagram and Twitter?
Is there any dataset available for similar posts recommendation like Facebook, Instagram and Twitter? I want to build a similar post recommendation system that a user sees after performing some activity on the news feed. For example: If he/she spends more time on sports posts, giving him/her sports recommended post so...
https://stackoverflow.com/questions/61742943/is-there-any-dataset-available-for-similar-posts-recommendation-like-facebook-i
dataset, artificial-intelligence, data-science, recommendation-engine, kaggle
1,589,251,897
se_74885479
stackoverflow
DATA_SCIENCE
Combining certain columns from three excel files in one pandas DF based on the column number-Using python pandas
Combining certain columns from three excel files in one pandas DF based on the column number-Using python pandas I have three excel files that was read to pandas DFs, the tables are below : DF1: Column A Column B F G M K DF2: Column A Column B J D N L DF3: Column A Column B Column C ...
https://stackoverflow.com/questions/74885479/combining-certain-columns-from-three-excel-files-in-one-pandas-df-based-on-the-c
python, pandas, dataframe, data-science
1,671,695,163
se_74867704
stackoverflow
DATA_SCIENCE
sklearn: print DecisionTreeRegressor's tree from IterativeImputer
sklearn: print DecisionTreeRegressor's tree from IterativeImputer I have an IterativeImputer that uses DecisionTreeRegressor as estimator and I want to print it's tree with export_text method: import pandas as pd from sklearn import tree from sklearn.experimental import enable_iterative_imputer # noqa from sklear...
https://stackoverflow.com/questions/74867704/sklearn-print-decisiontreeregressors-tree-from-iterativeimputer
python, machine-learning, scikit-learn, data-science
1,671,562,702
se_74872071
stackoverflow
DATA_SCIENCE
Best Approaches to summarize or aggregate multiple rows to single row for Machine learning model creation
Best Approaches to summarize or aggregate multiple rows to single row for Machine learning model creation Creating a ML model for predictive maintenance . table A contains log information with start time , end time and event status. table A Id startTime endTime event 100 7/1/2021 1:05:04 7/1/2021 1:06:04 OS ...
https://stackoverflow.com/questions/74872071/best-approaches-to-summarize-or-aggregate-multiple-rows-to-single-row-for-machin
machine-learning, data-science, aggregate, data-analysis
1,671,604,140
se_74861827
stackoverflow
DATA_SCIENCE
ValueError: Found input variables with inconsistent numbers of samples: [29100, 27300]
ValueError: Found input variables with inconsistent numbers of samples: [29100, 27300] The dataset is from a survey about 91 art pieces from 300 people. The first 91 columns are the preference ratings for each painting scored 1-7. The 91 columns after that are their ratings for the “energy” of the painting. Additional...
https://stackoverflow.com/questions/74861827/valueerror-found-input-variables-with-inconsistent-numbers-of-samples-29100
python, regression, data-science, linear-regression
1,671,532,993
se_74867521
stackoverflow
DATA_SCIENCE
R AOV giving different p-values compared to graphpad prism?
R AOV giving different p-values compared to graphpad prism? I'm running an ANOVA in R using aov, so I can analyze a lot of data at once. I've picked out a few samples to ensure accuracy, and my prism p-values are different than the ones I'm getting in R. My ANOVA in prism is not repeated measures. I saw this question:...
https://stackoverflow.com/questions/74867521/r-aov-giving-different-p-values-compared-to-graphpad-prism
r, statistics, data-science, anova
1,671,561,515
se_74867083
stackoverflow
DATA_SCIENCE
How to generate 2D random dataset for PCA
How to generate 2D random dataset for PCA I'm getting started on my ML journey. I'm using the data science handbook to learn about PCA. The following code snippet is used to generate a random 2D data set with a linear relationship. Could someone explain the intuition of how multiplying a 2x2 and 2x200 random matrices ...
https://stackoverflow.com/questions/74867083/how-to-generate-2d-random-dataset-for-pca
machine-learning, data-science
1,671,559,075
se_74862462
stackoverflow
DATA_SCIENCE
TfidfVectorizer it does not eliminate words that occur more than once
TfidfVectorizer it does not eliminate words that occur more than once I have a dataset that I'm trying to cluster into. Although I set min_df and max_df in the Tfidf, the output MiniBatchKmeans returns to me contains words that according to the documentation Vectorizer should eliminate because they are present in at l...
https://stackoverflow.com/questions/74862462/tfidfvectorizer-it-does-not-eliminate-words-that-occur-more-than-once
scikit-learn, data-science, k-means, tfidfvectorizer
1,671,536,036
se_74433774
stackoverflow
DATA_SCIENCE
Receive " No changes, no records " when creating relationship between 2 nodes
Receive " No changes, no records " when creating relationship between 2 nodes I'm trying to create a relationship between Client and Client Doctor, so here is what i've done: I tried this first then got "no changes, no records" notice LOAD CSV WITH HEADERS FROM "file:///Consultation.csv" AS row MATCH (c:Clie...
https://stackoverflow.com/questions/74433774/receive-no-changes-no-records-when-creating-relationship-between-2-nodes
database, neo4j, data-science
1,668,438,404
se_71686545
stackoverflow
DATA_SCIENCE
How can I generate matplotlib graphs faster
How can I generate matplotlib graphs faster I am currently doing an experiment with perlin noise, but generating this noise uses a series of plotted markers. Like, a bunch of them, and i need to render a lot of graphs, rendering just 20 takes around 15 minutes. Is there any way to speed up my code? import matplotlib.p...
https://stackoverflow.com/questions/71686545/how-can-i-generate-matplotlib-graphs-faster
python, numpy, matplotlib, data-science, perlin-noise
1,648,697,154
se_74799089
stackoverflow
DATA_SCIENCE
What can be the reasons for 95% of samples belong to one cluster when there are 5 clusters?
What can be the reasons for 95% of samples belong to one cluster when there are 5 clusters? I used the k-means algorithm to clustering set of documents which are textual data only. The number of documents are 2lack records Surprisingly the result for the clustering is 95% of records is storing in 1 cluster, remaining ...
https://stackoverflow.com/questions/74799089/what-can-be-the-reasons-for-95-of-samples-belong-to-one-cluster-when-there-are
python, machine-learning, scikit-learn, data-science, k-means
1,671,024,881
se_74821265
stackoverflow
DATA_SCIENCE
Can anyone know how to see the data in a cluster after doing k-means clustering?
Can anyone know how to see the data in a cluster after doing k-means clustering? Is there any code to see or view the data in a cluster after doing k-means clustering in python, so that i can know which type of data clustered into which cluster and why. help me with this ? The cluster file is in .File extension, so I ...
https://stackoverflow.com/questions/74821265/can-anyone-know-how-to-see-the-data-in-a-cluster-after-doing-k-means-clustering
python, machine-learning, scikit-learn, data-science, k-means
1,671,175,052
se_74853435
stackoverflow
DATA_SCIENCE
What's the range of RMSE? Is there a maximum value?
What's the range of RMSE? Is there a maximum value? What is the range of RMSE during a evaluation model? I know that close to 0 is better, but tis there a maximum value for this? I can't find the answer... If I have a 52 RMSE how can I say if it's a good result?
https://stackoverflow.com/questions/74853435/whats-the-range-of-rmse-is-there-a-maximum-value
machine-learning, model, regression, data-science, metrics
1,671,468,146
se_67718639
stackoverflow
DATA_SCIENCE
How to reverse-construct confusion matrix form evaluation metrics values?
How to reverse-construct confusion matrix form evaluation metrics values? We get statistics of evaluation metrics (like precision, recall, accuracy, etc.) from the confusion matrix. Is there any way to reverse the process? In a binary classification problem, I have results of the evaluation metrics: Precision, Recall,...
https://stackoverflow.com/questions/67718639/how-to-reverse-construct-confusion-matrix-form-evaluation-metrics-values
machine-learning, classification, data-science, reverse-engineering, confusion-matrix
1,622,104,786
se_74844395
stackoverflow
DATA_SCIENCE
matplotlib's ion() does not make any difference
matplotlib's ion() does not make any difference To test the matplotlib's interactive mode, I used the following two code snippets: Snippet 1: Has plt.ion() with no call to fig.canvas.draw(): import numpy as np import matplotlib.pyplot as plt x = np.array([]) y_1 = np.array([]) y_2 = np.array([]) plt.ion() fig =...
https://stackoverflow.com/questions/74844395/matplotlibs-ion-does-not-make-any-difference
python, matplotlib, data-science, matplotlib-animation, matplotlib-ion
1,671,397,280
se_74793086
stackoverflow
DATA_SCIENCE
Building a basic prediction model with the output being the sum of the two inputs but accuracy score is significantly low
Building a basic prediction model with the output being the sum of the two inputs but accuracy score is significantly low I have a csv of size 12500 X 3. The first two columns (A and B) are inputs and the the final column (C) is the sum of the two columns. I wanted to build a prediction model to get the value of C fo...
https://stackoverflow.com/questions/74793086/building-a-basic-prediction-model-with-the-output-being-the-sum-of-the-two-input
python, machine-learning, data-science
1,670,986,274
se_74843126
stackoverflow
DATA_SCIENCE
Recursion error: Dataprep function not working post cleaning data
Recursion error: Dataprep function not working post cleaning data Using dataprep API and I am getting a recursion error when I use the dataprep functions in Google Colab. Oddly it works fine on 144 features of uncleaned data. But once reduced to 20 features and clean the missing values, I get a recursion error Code: d...
https://stackoverflow.com/questions/74843126/recursion-error-dataprep-function-not-working-post-cleaning-data
python, jupyter-notebook, data-science, data-preprocessing
1,671,383,391
se_39174005
stackoverflow
DATA_SCIENCE
Faster AUC in sklearn or python
Faster AUC in sklearn or python I have over half a million pairs of true labels and predicted scores (the length of each 1d array varies and can be between 10,000-30,000 in length) that I need to calculate the AUC for. Right now, I have a for-loop that calls: # Simple Example with two pairs of true/predicted values i...
https://stackoverflow.com/questions/39174005/faster-auc-in-sklearn-or-python
python, scikit-learn, data-science, auc
1,472,242,237
se_74835341
stackoverflow
DATA_SCIENCE
pandas datareader should get stock market data but returns error
pandas datareader should get stock market data but returns error Here is the code: import pandas as pd import pandas_datareader.data as web import matplotlib.pyplot as plt start_date = "2020-01-01" end_date = "2020-12-31" data = web.DataReader(name="TSLA", data_source='yahoo', start=start_date, end=end_date) print(d...
https://stackoverflow.com/questions/74835341/pandas-datareader-should-get-stock-market-data-but-returns-error
python, pandas, data-science, pandas-datareader
1,671,291,621
se_74824860
stackoverflow
DATA_SCIENCE
How to open a PFA csv file
How to open a PFA csv file A client gave me a file in CSV format and called that PFA. I want to open a PFA file, but I got something like the one below. I would appreciate it if I get help from you. df=pd.read_csv( '/home/mikaeil/Downloads/ccd4b28d-4340-4e4f-a3b4-e2de3a2de142.csv') The result is like below: 0 f7106...
https://stackoverflow.com/questions/74824860/how-to-open-a-pfa-csv-file
python, csv, jupyter-notebook, data-science, opencsv
1,671,195,955
se_74833767
stackoverflow
DATA_SCIENCE
ValueError: Found input variables with inconsistent numbers of samples: [137, 68]
ValueError: Found input variables with inconsistent numbers of samples: [137, 68] I encountered an error while building a linear regression model. Judging by their shape, it seems appropriate. X = df_one_hot[features] y = df_one_hot["price"] X_train, y_train, X_test, y_test = train_test_split(X, y, test_size = 0.33, ...
https://stackoverflow.com/questions/74833767/valueerror-found-input-variables-with-inconsistent-numbers-of-samples-137-68
python, machine-learning, data-science, data-cleaning
1,671,277,193
se_74835683
stackoverflow
DATA_SCIENCE
how do i split a column into two in python on the basis of data in it
how do i split a column into two in python on the basis of data in it for instance the column i want to split is duration here, it has data points like - 110 or 2 seasons, i want to make a differerent column for seasons and in place of seasons in my current column it should say null as this would make the type of colu...
https://stackoverflow.com/questions/74835683/how-do-i-split-a-column-into-two-in-python-on-the-basis-of-data-in-it
python, csv, split, data-science
1,671,294,628
se_74829309
stackoverflow
DATA_SCIENCE
flip boxplot with conditional statement in Shiny app R
flip boxplot with conditional statement in Shiny app R I am generating a boxplot in Shiny app in R based on user input, The user selects one factor variable and one numeric variable then a box blot of these variables is shown. My problem is that; some of the factor variables have more than 10 levels, the x-axis labels...
https://stackoverflow.com/questions/74829309/flip-boxplot-with-conditional-statement-in-shiny-app-r
r, shiny, data-science, shinyapps
1,671,221,360
se_74812287
stackoverflow
DATA_SCIENCE
How to fix NaN values in concatenated multiple tables in Jupyter Notebook
How to fix NaN values in concatenated multiple tables in Jupyter Notebook I am using Jupyter Notedbook. I have concatenated multiple tables. When I run the head() command I am not able to see the values in age and gender columns in a table rather than it's showing me NaN values against each user_id. The following imag...
https://stackoverflow.com/questions/74812287/how-to-fix-nan-values-in-concatenated-multiple-tables-in-jupyter-notebook
python-3.x, machine-learning, jupyter-notebook, data-science, data-analysis
1,671,110,862
se_74549641
stackoverflow
DATA_SCIENCE
Scikit-Learn issues error for RandomForestClassifier for multilabel classification - Jagged arrays
Scikit-Learn issues error for RandomForestClassifier for multilabel classification - Jagged arrays Scikit-Learn RandomForestClassifier throws an error for a multilabel classification problem. This code creates a RandomForestClassifier multilabel object, given predictors C and multi-labels out with no error. C = np.a...
https://stackoverflow.com/questions/74549641/scikit-learn-issues-error-for-randomforestclassifier-for-multilabel-classificati
machine-learning, scikit-learn, data-science, random-forest, multilabel-classification
1,669,218,815
se_74828255
stackoverflow
DATA_SCIENCE
ModuleNotFoundError: No module named 'sklearn.feature_extraction.dict_vectorizer'
ModuleNotFoundError: No module named 'sklearn.feature_extraction.dict_vectorizer' I am trying to preprocess a bengali dataset using BLTK. But, it gives me an error. I dont know why. I have sci-kit learn installed and updated it. This is my code: from bltk.langtools import remove_stopwords from bltk.langtools i...
https://stackoverflow.com/questions/74828255/modulenotfounderror-no-module-named-sklearn-feature-extraction-dict-vectorizer
python, machine-learning, scikit-learn, jupyter-notebook, data-science
1,671,214,037
se_74828103
stackoverflow
DATA_SCIENCE
Is there a way to combine these sklearn Pipelines/ColumnTransformers so I don't have to make multiple fit_transform() calls?
Is there a way to combine these sklearn Pipelines/ColumnTransformers so I don't have to make multiple fit_transform() calls? I'd like to create a Pipeline where I can call fit_transform() just one time on my train dataset (train_df) and receive a fully preprocessed dataset. I don't think I can currently do that, h...
https://stackoverflow.com/questions/74828103/is-there-a-way-to-combine-these-sklearn-pipelines-columntransformers-so-i-dont
python, machine-learning, scikit-learn, data-science, sklearn-pandas
1,671,213,059
se_74828686
stackoverflow
DATA_SCIENCE
Retrieve Dataframe value(s) if the percentage of a string existing in another Dataframe row is >= 75%
Retrieve Dataframe value(s) if the percentage of a string existing in another Dataframe row is >= 75% Well, this is burning my brain and I decided to ask it here. I have two existing Dataframes, the first one contains a small description of a physical object, and the other Dataframe usually has a detailed descripti...
https://stackoverflow.com/questions/74828686/retrieve-dataframe-values-if-the-percentage-of-a-string-existing-in-another-da
python, python-3.x, pandas, dataframe, data-science
1,671,216,922
se_74825075
stackoverflow
DATA_SCIENCE
As a learning data scientist, how do I understand which decoder to use?
As a learning data scientist, how do I understand which decoder to use? I wanted to decode a string into its original data value, I'm not sure if I took the right steps, or if had used the wrong encoder, is there anyway to know which encoder to use when receiving decoded data? import base64 x = 'f71069a5840386c6ece10...
https://stackoverflow.com/questions/74825075/as-a-learning-data-scientist-how-do-i-understand-which-decoder-to-use
python-3.x, data-science
1,671,197,147
se_73851229
stackoverflow
DATA_SCIENCE
Plotting Quarterly Data - Plotly
Plotting Quarterly Data - Plotly I am trying to plot the below line chart in plotly, but my x axis is a quarter such as df['quarter'] = pd.PeriodIndex(df.date, freq='Q') quarter 2017Q1 2017Q2 ... fig = px.line(qtrly_comp, x="quarter", y="counts",template=template_style,markers = True) fig.show() I am getting error...
https://stackoverflow.com/questions/73851229/plotting-quarterly-data-plotly
python, python-3.x, data-science, plotly
1,664,179,754
se_74803010
stackoverflow
DATA_SCIENCE
Multiprocessing in python - saving memory by adding results
Multiprocessing in python - saving memory by adding results I'm simulating a physical problem under different initial conditions using Python. As these realizations are completely independent of each other, I wanted to use the multiprocessing package. Now, the result of one realization can easily be a few 100 Mb large...
https://stackoverflow.com/questions/74803010/multiprocessing-in-python-saving-memory-by-adding-results
python, multiprocessing, data-science, python-multiprocessing
1,671,044,049
se_74817271
stackoverflow
DATA_SCIENCE
How can I solve this Isin problem? I cant make it
How can I solve this Isin problem? I cant make it I'm having a problem, I try some stuff but i still Can't make it. This is my DF. But my problem is some steps ahead. Here its my code and then I explain: df1 = df1.iloc[6:] del df1['Unnamed: 0'] del df1['Unnamed: 3'] df1.rename(columns={'Unnamed: 1': 'Fecha', 'Unnamed...
https://stackoverflow.com/questions/74817271/how-can-i-solve-this-isin-problem-i-cant-make-it
pandas, dataframe, date, data-science, isin
1,671,136,530
se_74791338
stackoverflow
DATA_SCIENCE
If the same string is in the first column of a sorted dataframe take the rows associated with the unique value and create new dataframes
If the same string is in the first column of a sorted dataframe take the rows associated with the unique value and create new dataframes What I am looking to do is for every email address that is the same, take the corresponding rows with that same email and create new dataframes and then send an email with the row in...
https://stackoverflow.com/questions/74791338/if-the-same-string-is-in-the-first-column-of-a-sorted-dataframe-take-the-rows-as
python, dataframe, data-science, columnsorting
1,670,968,785
se_74813673
stackoverflow
DATA_SCIENCE
How to parametrise unit tests for sklearn models
How to parametrise unit tests for sklearn models I want to create some unit tests to make sure the correct NotImplemented exceptions are thrown for a module I am developing. Is there a way that I could use some dummy data, create and fit multiple sklearn models to feed into the unit tests? I'm looking for a parametric...
https://stackoverflow.com/questions/74813673/how-to-parametrise-unit-tests-for-sklearn-models
python, unit-testing, machine-learning, scikit-learn, data-science
1,671,117,153
se_72988186
stackoverflow
DATA_SCIENCE
Saving segmented csv files after separating them by a column value
Saving segmented csv files after separating them by a column value I'm trying to segment a csv file of names and emails. The file has first_name, last_name, email, and email domain. I need to classify them by 'business' or 'individual' email. the data looks like this: CSV File import pandas as pd data = pd.read_csv("...
https://stackoverflow.com/questions/72988186/saving-segmented-csv-files-after-separating-them-by-a-column-value
python, pandas, csv, data-science, business-intelligence
1,657,848,522
se_74814114
stackoverflow
DATA_SCIENCE
How can I create an int variable?
How can I create an int variable? I wonderer how can I create an int variable that contains an huge amount of 0's and and big amount of 1's to do a Data Science models. I know how crated a variable but not how to create a variable that contains lots of ints rapidly, I tried using fillna() to complete a variable, but I...
https://stackoverflow.com/questions/74814114/how-can-i-create-an-int-variable
python, pandas, jupyter-notebook, data-science, fillna
1,671,119,075
se_74788481
stackoverflow
DATA_SCIENCE
Why can't I change the dtype of a variable?
Why can't I change the dtype of a variable? I am doing some Kaggle competition called TitanicSpaceship (https://www.kaggle.com/competitions/spaceship-titanic) and I had an error: train['CryoSleep'] = train['CryoSleep'].map({'False':0, 'True':1}).astype(int) IntCastingNaNError: Cannot convert non-finite values (NA ...
https://stackoverflow.com/questions/74788481/why-cant-i-change-the-dtype-of-a-variable
python, pandas, integer, data-science, imputation
1,670,951,286
se_74811497
stackoverflow
DATA_SCIENCE
How to combine two columns (a simple multiplication and addition) from a .csv file to a new one using Python?
How to combine two columns (a simple multiplication and addition) from a .csv file to a new one using Python? I am new to programming and this seems like an easy one but I do not have experience so I need help. Thank you So, I am doing an NBA themed task in which I need to make a column (feature) called TOTAL_GAME_TIM...
https://stackoverflow.com/questions/74811497/how-to-combine-two-columns-a-simple-multiplication-and-addition-from-a-csv-fi
python, python-3.x, pandas, csv, data-science
1,671,107,165
se_74803563
stackoverflow
DATA_SCIENCE
Why RFECV visualizer from yellowbrick finds number of optimal features more than number of features in train set?
Why RFECV visualizer from yellowbrick finds number of optimal features more than number of features in train set? I am trying to perform feature selection and to use RFECV from yellowbrick.model_selection. I have 48 features in my train set. But when I run the code in below, the visualizer finds number of features as ...
https://stackoverflow.com/questions/74803563/why-rfecv-visualizer-from-yellowbrick-finds-number-of-optimal-features-more-than
scikit-learn, data-science, feature-selection, yellowbrick
1,671,047,768
se_74801775
stackoverflow
DATA_SCIENCE
Why BeautifulSoup returning same information over and over again
Why BeautifulSoup returning same information over and over again When I am trying to scrap website over multiple pages BeautifulSoup returning the 1st page content for all the page range.. It is getting repeated again and again.. data=pd.DataFrame() for i in range(1,10): headers = {'User-Agent': 'Mozilla/5.0 (Macint...
https://stackoverflow.com/questions/74801775/why-beautifulsoup-returning-same-information-over-and-over-again
python, python-3.x, web-scraping, beautifulsoup, data-science
1,671,037,182
se_74788520
stackoverflow
DATA_SCIENCE
Does the order of an ARMA(p,0) model mean it uses the last p lags or any previous p lags?
Does the order of an ARMA(p,0) model mean it uses the last p lags or any previous p lags? I'm having a problem with the definition of order of AR, MA and ARMA time series forecasting processes. Imagine we have a time series with data from January to December, and we're in July, trying to predict August. When we say AR...
https://stackoverflow.com/questions/74788520/does-the-order-of-an-armap-0-model-mean-it-uses-the-last-p-lags-or-any-previou
math, time-series, data-science, forecasting, arima
1,670,951,454
se_74795623
stackoverflow
DATA_SCIENCE
couldn't download table dataset from https://www.nordpoolgroup.com/en/Market-data1/#/nordic/table
couldn't download table dataset from https://www.nordpoolgroup.com/en/Market-data1/#/nordic/table I am working on my data science homework. I am trying to download the weekly table data by using pyython from : https://www.nordpoolgroup.com/en/Market-data1/Dayahead/Area-Prices/ALL1/Hourly12/?view=table for my exam....
https://stackoverflow.com/questions/74795623/couldnt-download-table-dataset-from-https-www-nordpoolgroup-com-en-market-dat
python, web, beautifulsoup, data-science, screen-scraping
1,671,007,809
se_74795298
stackoverflow
DATA_SCIENCE
How to create a new dictionary from two other dictionaries taking different keys and values with iteration?
How to create a new dictionary from two other dictionaries taking different keys and values with iteration? I have two dictionaries as input. The first one contains pin numbers as keys and as values - the probability of a certain code. `dict_1={ 8063: {'code15': 99.61, 'code17': 96.14}, 9621: {'15': 88.59}, 1583: {'co...
https://stackoverflow.com/questions/74795298/how-to-create-a-new-dictionary-from-two-other-dictionaries-taking-different-keys
python, python-3.x, data-structures, jupyter-notebook, data-science
1,671,005,885
se_74793282
stackoverflow
DATA_SCIENCE
Removing All Text From a Column
Removing All Text From a Column I am trying to teach myself Python for data analysis, and I am working with a dataset that contains both strings and integers. enter image description here I was able to fix the reviews_avg column by using : df['reviews_avg_num'] = df['reviews_avg'].str[8:11] That took out all text and ...
https://stackoverflow.com/questions/74793282/removing-all-text-from-a-column
python, python-3.x, dataframe, data-science, data-analysis
1,670,988,605
se_58872043
stackoverflow
DATA_SCIENCE
I am trying to make my data balanced as my target variable has multi-class and I want to oversample it to make my data balanced
I am trying to make my data balanced as my target variable has multi-class and I want to oversample it to make my data balanced Let x contain the variables: print(x) Restaurant Cuisines Average_Cost Rating Votes Reviews Area 0 3.526361 0.693147 5.303305 1.504077 2.564949 1.609438 ...
https://stackoverflow.com/questions/58872043/i-am-trying-to-make-my-data-balanced-as-my-target-variable-has-multi-class-and-i
python, machine-learning, data-science, imblearn
1,573,802,235
se_65958883
stackoverflow
DATA_SCIENCE
The difference between smote.fit_sample() and smote.fit_resample()
The difference between smote.fit_sample() and smote.fit_resample() In imblearn, what is the difference between smote.fit_sample() and smote.fit_resample(), and when should we use one over the other?
https://stackoverflow.com/questions/65958883/the-difference-between-smote-fit-sample-and-smote-fit-resample
python, python-3.x, data-science, imblearn
1,611,940,323
se_74738205
stackoverflow
DATA_SCIENCE
How do I gather information from 3 dataframes in pandas with custom headers?
How do I gather information from 3 dataframes in pandas with custom headers? I am learning pandas and doing some exercies but without much source So basically I have these 4 dataframes below: So for every bill in the dataset, i want to know how many legislators supported the bill and how many legislators opposed the...
https://stackoverflow.com/questions/74738205/how-do-i-gather-information-from-3-dataframes-in-pandas-with-custom-headers
python, pandas, dataframe, pyspark, data-science
1,670,551,328
se_74792191
stackoverflow
DATA_SCIENCE
Probabilistic Bounds for a Strictly Positive Machine Learning Point Estimate?
Probabilistic Bounds for a Strictly Positive Machine Learning Point Estimate? I'm trying to create some probabilistic bounds for my machine learning regression predictions. What I'm currently doing is taking the output of the regression algorithm (I'm predicting team points scored), passing it in as the mean to a norm...
https://stackoverflow.com/questions/74792191/probabilistic-bounds-for-a-strictly-positive-machine-learning-point-estimate
machine-learning, scipy, statistics, data-science, probability
1,670,975,743
se_74791314
stackoverflow
DATA_SCIENCE
Why does dbscan perform poorly on this dataset
Why does dbscan perform poorly on this dataset I have the following dataset and I am using the dbscan algorithm to try and perform clustering. However no matter what values for min points and eps I choose I get very few and very bad clusters. Isn't dbscan supposed to perform well on clusters of similar density that a...
https://stackoverflow.com/questions/74791314/why-does-dbscan-perform-poorly-on-this-dataset
data-science, cluster-analysis
1,670,968,559
se_74789876
stackoverflow
DATA_SCIENCE
Converting latitude/longitude to decimal degrees for entire data frame
Converting latitude/longitude to decimal degrees for entire data frame I'm trying to convert columns of latitude and longitude and create a new column for decimal degrees. Both code examples work great for a single coordinate (also from Stack Overflow), but I need to iterate over multiple columns. latitude = "20-18-6....
https://stackoverflow.com/questions/74789876/converting-latitude-longitude-to-decimal-degrees-for-entire-data-frame
python, data-science, latitude-longitude
1,670,958,937
se_74775126
stackoverflow
DATA_SCIENCE
what R Code to calculate the entropy for each level in a categorical variable
what R Code to calculate the entropy for each level in a categorical variable I have quite some categorical variable in my dataset, These variables have more than two levels each. Now i want an R code function (or loop) that can calculate the entropy and information gain for each levels in each categorical variable an...
https://stackoverflow.com/questions/74775126/what-r-code-to-calculate-the-entropy-for-each-level-in-a-categorical-variable
r, dataframe, data-science, entropy, information-gain
1,670,866,708
se_74788905
stackoverflow
DATA_SCIENCE
How to collapse levels in a categorical variable in R
How to collapse levels in a categorical variable in R I have various categorical variable with more than 5 levels each, I want a function that can collapse them into just two levels column1<- c("bad","good","nice","fair","great","bad","bad","good","nice", "fair","great","bad") column2<- c("john","ben","coo...
https://stackoverflow.com/questions/74788905/how-to-collapse-levels-in-a-categorical-variable-in-r
r, dataframe, data-science
1,670,953,372
se_74786810
stackoverflow
DATA_SCIENCE
Is there a better way to replace the &quot;for&quot; loop in python?
Is there a better way to replace the &quot;for&quot; loop in python? Can someone help me? I have a huge dataframe to work with (90 thousand rows) and I need to apply this logic, but I can only think of solving the problem using a 'for' loop, and this is taking almost 2 hours to run... Can someone give me some light on...
https://stackoverflow.com/questions/74786810/is-there-a-better-way-to-replace-the-for-loop-in-python
python, pandas, dataframe, data-science
1,670,943,619
se_74786916
stackoverflow
DATA_SCIENCE
Why Imputation converts float64 column to object and not converting again?
Why Imputation converts float64 column to object and not converting again? I just did mean imputation on a pandas dataframe, but the column after imputation in converted to object type and is not converting back to float. I tried astype(float), which says need a string not a method, to_numeric() also donot work. this ...
https://stackoverflow.com/questions/74786916/why-imputation-converts-float64-column-to-object-and-not-converting-again
pandas, machine-learning, scikit-learn, statistics, data-science
1,670,944,033
se_74779033
stackoverflow
DATA_SCIENCE
checkboxGroupButton - Select one at a time
checkboxGroupButton - Select one at a time I'm trying to create a radiobutton in the style of the checkboxGroupButton() in R shiny. I want to recreate this example with the same button aesthetics, but only allow the user to select one input at a time. library(shiny) library(shinyWidgets) ui <- fluidPage( tags$h1("c...
https://stackoverflow.com/questions/74779033/checkboxgroupbutton-select-one-at-a-time
r, shiny, data-science, shinywidgets
1,670,894,472
se_74760126
stackoverflow
DATA_SCIENCE
Custom objects classifier always returns one of classes even if the picture belongs to none of them
Custom objects classifier always returns one of classes even if the picture belongs to none of them My fruit detection app shows fruit results even though the user uploads a picture that is not a fruit. Is it possible to display a "no plant detected" message? My code: private void classifyImage(Bitmap image) { try...
https://stackoverflow.com/questions/74760126/custom-objects-classifier-always-returns-one-of-classes-even-if-the-picture-belo
java, machine-learning, data-science, image-classification
1,670,755,498
se_74771579
stackoverflow
DATA_SCIENCE
How can I create a new column in a pandas data frame by extracting words from sentences in another column?
How can I create a new column in a pandas data frame by extracting words from sentences in another column? I have a pandas dataframe like this. import pandas as pd student_id = ['001', '002', '003', '004'] names = ['Jane', 'Mary', 'Andrew', 'Paul'] address = ['7 karumu st Ikeja Lagos', '8 logo street Umuahia Abia', ...
https://stackoverflow.com/questions/74771579/how-can-i-create-a-new-column-in-a-pandas-data-frame-by-extracting-words-from-se
python, pandas, dataframe, loops, data-science
1,670,850,484
se_74765501
stackoverflow
DATA_SCIENCE
How do I do linear regression on count output with continuous predictor? (Sentiment Analysis
How do I do linear regression on count output with continuous predictor? (Sentiment Analysis So i have a sentiment value (range -2<x<2) with an attached categorical data (0,1). i want to see if the sentiment value can predict the number of categorical data. How would I do this? which model am I to use? data is like th...
https://stackoverflow.com/questions/74765501/how-do-i-do-linear-regression-on-count-output-with-continuous-predictor-sentim
r, statistics, regression, data-science, sentiment-analysis
1,670,803,341
se_74668460
stackoverflow
DATA_SCIENCE
Which learning model should be chosen to predict text news tags?
Which learning model should be chosen to predict text news tags? I have a database of news texts (100000 samples). Half of the dataset is tagged, and half is not, what methodology can I use to analyze the remaining news and fill them with tags? Data example: Text = A cap on the price of Russian oil will restrict Russ...
https://stackoverflow.com/questions/74668460/which-learning-model-should-be-chosen-to-predict-text-news-tags
python, nlp, data-science, data-analysis, tagging
1,670,084,533
se_74692140
stackoverflow
DATA_SCIENCE
combining Machine learning models
combining Machine learning models Is there is a way to combine multiple ML models where each model use a dataset with different features but same outcome? I find a way to combine models which is ensemble learning but its only applicable for datasets with the same features
https://stackoverflow.com/questions/74692140/combining-machine-learning-models
machine-learning, deep-learning, dataset, data-science
1,670,261,459
se_74688095
stackoverflow
DATA_SCIENCE
How to helpfully plot time series data in python
How to helpfully plot time series data in python I have a 2 Dimensional set of time series data containing about 1000 samples. I.e I have a long list of 1000 elements each entry is a list of two numbers. It can be thought of the position, x and y coordinates, of a car with a picture taken each second for 1000 seconds....
https://stackoverflow.com/questions/74688095/how-to-helpfully-plot-time-series-data-in-python
python, matplotlib, data-science, visualization
1,670,242,816
se_74718879
stackoverflow
DATA_SCIENCE
type error while creating confusion matrix
type error while creating confusion matrix I'm trying to create a confusion_matrix but I get the following error: TypeError: Labels in y_true and y_pred should be of the same type. Got y_true=[False True] and y_pred=['False' 'True']. Make sure that the predictions provided by the classifier coincide with the true lab...
https://stackoverflow.com/questions/74718879/type-error-while-creating-confusion-matrix
python, machine-learning, scikit-learn, data-science, confusion-matrix
1,670,425,979
se_74742670
stackoverflow
DATA_SCIENCE
How is the resultant likelihood matrix from a multivariate Gaussian distribution used in Bayesian classification?
How is the resultant likelihood matrix from a multivariate Gaussian distribution used in Bayesian classification? I am attempting to make a Bayesian classification algorithm using multivariate Gaussian distribution, but I can't figure out how to extract the probabilities from the resultant matrix from this equation: ...
https://stackoverflow.com/questions/74742670/how-is-the-resultant-likelihood-matrix-from-a-multivariate-gaussian-distribution
matlab, machine-learning, statistics, data-science, bayesian
1,670,586,297
se_74745340
stackoverflow
DATA_SCIENCE
Plot X Y coordinates in PowerBI
Plot X Y coordinates in PowerBI I've been provided with a PoweBI license and I have a set of x and y coordinates. I would like to plot each coordinate over a rectangle which represents a football pitch. At a later stage overlay an actual football pitch (see images below). I would just like to get information/guidance ...
https://stackoverflow.com/questions/74745340/plot-x-y-coordinates-in-powerbi
r, python-3.x, powerbi, data-science
1,670,600,904
se_74582320
stackoverflow
DATA_SCIENCE
Adding foreign Key in table is taking too long
Adding foreign Key in table is taking too long I have two tables (using mysql) : tactic_themes(code_tac,code_th) and tactics(code_tac,tactic_data) which tactic_themes contains 13 million rows and tactics 3 million rows but running query that makes "code_tac" column a foreign key takes too long, i mean more than 2 hour...
https://stackoverflow.com/questions/74582320/adding-foreign-key-in-table-is-taking-too-long
mysql, sql, database, data-science
1,669,467,124
se_74657539
stackoverflow
DATA_SCIENCE
Mismatched in actual number of classes and classes after test/train generator
Mismatched in actual number of classes and classes after test/train generator The number of classes after test/train image generator applied is different from the original actual number of classes. Initially, I have 4 folders (4 classes) After test/train generator I am getting 5 classes Code: input_shape = (128, 128...
https://stackoverflow.com/questions/74657539/mismatched-in-actual-number-of-classes-and-classes-after-test-train-generator
tensorflow, machine-learning, keras, conv-neural-network, data-science
1,669,992,364
se_74579456
stackoverflow
DATA_SCIENCE
Is there any way I can fix the error string indices must be integers?
Is there any way I can fix the error string indices must be integers? I tried to make graphs for my csv dataset in Jupyter Notebook, using this line of code: bank['marital'].value_counts().plot(kind='pie',autopct='%.2f') plt.show() However, the system return, "string indices must be integers". I have tried to use ma...
https://stackoverflow.com/questions/74579456/is-there-any-way-i-can-fix-the-error-string-indices-must-be-integers
string, graph, jupyter-notebook, dataset, data-science
1,669,432,302
se_74747082
stackoverflow
DATA_SCIENCE
Matplotlib hist doesn&#39;t calculate the correct heights of bars
Matplotlib hist doesn&#39;t calculate the correct heights of bars I read data from a csv file and then calculate the amount of bins according to sturges rule. Then I make a histogram using matplotlib, but I don't get what I expect. import matplotlib.pyplot as plot height = [167, 170, 173, 173, 173, 174, 175, 178, 180...
https://stackoverflow.com/questions/74747082/matplotlib-hist-doesnt-calculate-the-correct-heights-of-bars
python, matplotlib, data-science
1,670,611,034
se_74704230
stackoverflow
DATA_SCIENCE
Why adding new data in time series affects yhat (predictions) in the past in Prophet?
Why adding new data in time series affects yhat (predictions) in the past in Prophet? I am using Prophet to predict a time serie. However, if I drop last month, yhat in the past changes. I think the expected result is to modify the future prediction, not the past. Is that behaviour correct? How can I make a month yhat...
https://stackoverflow.com/questions/74704230/why-adding-new-data-in-time-series-affects-yhat-predictions-in-the-past-in-pro
python, data-science, arima, prophet
1,670,337,052
se_74745386
stackoverflow
DATA_SCIENCE
pd.fillna or pd.DataFrame.loc for NaN values by function with condition
pd.fillna or pd.DataFrame.loc for NaN values by function with condition Hi everyone? i white a function to replace NaN values in DataFrame (1750 000 lines): def Android_iOs_device_os_cange(df): def find_Android_brand(df): list_for_android = list(df[df['device_os'] == 'Android'].device_brand.unique()) ...
https://stackoverflow.com/questions/74745386/pd-fillna-or-pd-dataframe-loc-for-nan-values-by-function-with-condition
python, pandas, function, loops, data-science
1,670,601,152
se_74732457
stackoverflow
DATA_SCIENCE
How to solve the following 3-dimensional system of non-linear inequalities in R?
How to solve the following 3-dimensional system of non-linear inequalities in R? I need to solve the following system of non-linear inequalities: x*y >= 420 x*z >= 14 x*y*z < 5000 I have tried to find a similar question/solution or package that helps, but I struggle to apply it to that specific case. The expected out...
https://stackoverflow.com/questions/74732457/how-to-solve-the-following-3-dimensional-system-of-non-linear-inequalities-in-r
r, data-science, nonlinear-optimization, inequalities
1,670,512,379
se_72123229
stackoverflow
DATA_SCIENCE
Save &amp; load best model in AutoTS python
Save &amp; load best model in AutoTS python After fitting AutoTS model over some time series data, how can I save & load the best model trained? Though, the AutoTS object has export_template() & import_template() functions to save best model, but while loading best model from this template, it requires re-fitting. How...
https://stackoverflow.com/questions/72123229/save-load-best-model-in-autots-python
python, machine-learning, time-series, data-science, forecasting
1,651,734,657
se_74208216
stackoverflow
DATA_SCIENCE
Matplotlib &quot;LinearSegmentedColormap&quot; error
Matplotlib &quot;LinearSegmentedColormap&quot; error Can someone help me with this error of matplotlib? I'm using jupyter for some data science project from a famous book (hands-on machine learning...) but I have a problem with an unusual error. This is the code: %matplotlib inline import matplotlib.pyplot as plt ho...
https://stackoverflow.com/questions/74208216/matplotlib-linearsegmentedcolormap-error
matplotlib, data-science, jupyter
1,666,789,209
se_74724904
stackoverflow
DATA_SCIENCE
Is there a way to count how many entries exists with a certain filter for python pandas?
Is there a way to count how many entries exists with a certain filter for python pandas? This might seem very basic but I am new to Pandas, the title might not be accurate but I have good screenshots below This is sort of a voting app I have the vote_results dataframe: And the legislators dataframe: This is the data...
https://stackoverflow.com/questions/74724904/is-there-a-way-to-count-how-many-entries-exists-with-a-certain-filter-for-python
python, pandas, dataframe, pyspark, data-science
1,670,467,097
se_74723908
stackoverflow
DATA_SCIENCE
Converting float64 column to int column
Converting float64 column to int column Notice that ProviderID, Vender and PCP in df_claims are float strings (Ex. 12231.0), which isn't accurate representation. These columns are ID's for respective entities, and ideally should be int (Ex. 12231). Convert these columns to int, handling the missing values separately. ...
https://stackoverflow.com/questions/74723908/converting-float64-column-to-int-column
python, pandas, database, dataframe, data-science
1,670,455,406
se_74723291
stackoverflow
DATA_SCIENCE
Extracting Unstructured data with python - Extracting tables from a scanned book
Extracting Unstructured data with python - Extracting tables from a scanned book I wish to extract tables to excel from a scanned booklet. sample pdf can be found here It is in .pdf format though the tables appear as an image as it is scanned. Tried Camelot and PyMuPDF but seem to get it wrong somewhere. Here is the c...
https://stackoverflow.com/questions/74723291/extracting-unstructured-data-with-python-extracting-tables-from-a-scanned-book
python, python-3.x, pandas, dataframe, data-science
1,670,450,548