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_76474969
stackoverflow
DATA_SCIENCE
Why does the KS-Test give a p-value of 1 if the distribution is different
Why does the KS-Test give a p-value of 1 if the distribution is different Let's take two sets: a = [5,5,5,5,5,4,4,4,4,3,3,3,2,2,1] b = [5,4,3,2,1] We perform the KS-Test using Python: from scipy import stats stats.ks_2samp(b,a) KstestResult(statistic=0.2, pvalue=0.9979360165118678, statistic_location=2, statistic_sig...
https://stackoverflow.com/questions/76474969/why-does-the-ks-test-give-a-p-value-of-1-if-the-distribution-is-different
python, statistics, data-science, kolmogorov-smirnov
1,686,754,962
se_72206460
stackoverflow
DATA_SCIENCE
Python/Matplotlib plot vertical line for specific dates in line chart
Python/Matplotlib plot vertical line for specific dates in line chart I used pandas to read a CSV file of the stock data of Tesla and plotted a line chart of the price in 2021. Also, I have dates = [] with a collection of dates, which I want to plot in the same line chart with vertical lines. My code: import pandas a...
https://stackoverflow.com/questions/72206460/python-matplotlib-plot-vertical-line-for-specific-dates-in-line-chart
python, pandas, matplotlib, data-science
1,652,296,510
se_76474620
stackoverflow
DATA_SCIENCE
How can I get history subscriber count in Youtube? E.g. How to see what is the subscriber count at the end of 2022 vs 2023
How can I get history subscriber count in Youtube? E.g. How to see what is the subscriber count at the end of 2022 vs 2023 Apologies, if my question is unclear as I am new to this space. I am trying to do a data analysis project for my portfolio about youtube channel. I would like to compare the youtube channel growth...
https://stackoverflow.com/questions/76474620/how-can-i-get-history-subscriber-count-in-youtube-e-g-how-to-see-what-is-the-s
google-api, youtube-api, data-science, data-analysis, youtube-data-api
1,686,752,701
se_76473828
stackoverflow
DATA_SCIENCE
ModuleNotFoundError: No module named 'tapas.utils'
ModuleNotFoundError: No module named 'tapas.utils' I am getting the above error while trying to import these method. I am using Collab. from tapas.utils import tf_example_utils from tapas.protos import interaction_pb2 from tapas.utils import number_annotation_utils from tapas.scripts import prediction_utils I ...
https://stackoverflow.com/questions/76473828/modulenotfounderror-no-module-named-tapas-utils
machine-learning, data-science, artificial-intelligence
1,686,747,318
se_76394823
stackoverflow
DATA_SCIENCE
ModuleNotFoundError: No module named 'sklearn.ensemble._bagging'
ModuleNotFoundError: No module named 'sklearn.ensemble._bagging' ModuleNotFoundError: No module named 'sklearn.ensemble._bagging' Which version is suitable of scikit learn for the above error? I am facing this issue when I am using the python 3.7 version. And I can't update the version.
https://stackoverflow.com/questions/76394823/modulenotfounderror-no-module-named-sklearn-ensemble-bagging
github, data-science, python-3.7, data-science-experience, github-issues
1,685,773,844
se_76467917
stackoverflow
DATA_SCIENCE
Webscraping images from google images
Webscraping images from google images I have recently been trying to scrape images of a specific type from Google through beautiful soup, but most of the markup seems hidden or not displayed when fetching the data from the URL. But when I inspect the URL I am able to see everything. Is there anything Google is doing t...
https://stackoverflow.com/questions/76467917/webscraping-images-from-google-images
python, web-scraping, beautifulsoup, data-science
1,686,682,238
se_76461002
stackoverflow
DATA_SCIENCE
How do I convert a Vec <&str> to Vec <String>?
How do I convert a Vec &lt;&amp;str&gt; to Vec &lt;String&gt;? let parts: Vec<String> = line.split_whitespace().collect(); let parts: Vec<String> = map(AsRef::as_ref).line.split_whitespace().collect(); if parts.len() >= 3 { let attribute_name = parts[1].to_string(); let attribute_type = parts[2].to_lowercase()...
https://stackoverflow.com/questions/76461002/how-do-i-convert-a-vec-str-to-vec-string
rust, data-science, arff
1,686,615,713
se_76197079
stackoverflow
DATA_SCIENCE
Unable to Run Simple Fine-Tuning of GPT-J Model
Unable to Run Simple Fine-Tuning of GPT-J Model I have been trying to learn to fine tune Large Language Models (LLM), specifically GPT-J from HuggingFace. I have been struggling to make even simple examples work on custom datasets. I wanted to train the model to produce google reviews, and was hoping to train it on ...
https://stackoverflow.com/questions/76197079/unable-to-run-simple-fine-tuning-of-gpt-j-model
python, data-science, artificial-intelligence, huggingface-transformers, transformer-model
1,683,511,207
se_76303952
stackoverflow
DATA_SCIENCE
Mysterious &quot;Segmentation fault&quot; error when running a Fortran program
Mysterious &quot;Segmentation fault&quot; error when running a Fortran program P.P.P.P.S Finally, I have found out the reason of the problem. Errors occurs on the variable vbuf, which is a Pointer type and its shape was defined previously. The shape of vbuf supposed to be (\nland,tidx2-tidx1+1\) but it was uncorrectly...
https://stackoverflow.com/questions/76303952/mysterious-segmentation-fault-error-when-running-a-fortran-program
fortran, data-science, hdf5, netcdf4
1,684,741,181
se_76451829
stackoverflow
DATA_SCIENCE
Feature Engineering in Python
Feature Engineering in Python How do I know when to apply LabelEncoder() or OneHotEncoder()? I have used LabelEncoder to encode categorical variable for RandomForestRegressor model and it gives a extremely high mean squared error. I have tried hyperparameter tuning with GridSearchCV and it still gives the same value
https://stackoverflow.com/questions/76451829/feature-engineering-in-python
python, data-science, one-hot-encoding, feature-engineering, label-encoding
1,686,506,590
se_76449810
stackoverflow
DATA_SCIENCE
How to iterate through a website that shows no index in the URL
How to iterate through a website that shows no index in the URL I'm trying to get data from "https://chainplay.gg/" but I'm stuck and I can't get data other than that on page one. This is the code I wrote and it returns the .csv I'm looking for but, without getting me the other 44 pages of data I can't do much with it...
https://stackoverflow.com/questions/76449810/how-to-iterate-through-a-website-that-shows-no-index-in-the-url
python, dataframe, web-scraping, data-science
1,686,475,478
se_76444291
stackoverflow
DATA_SCIENCE
How to convert a complex datasheet into a usabale dataframe?
How to convert a complex datasheet into a usabale dataframe? So I have the following google sheet link: https://docs.google.com/spreadsheets/d/1GAH6Cb8JuloDAiTIGnEr9GtPPyHWXMpOLV6nHNSgcoM/edit#gid=1324085625 This sheet is a school timetable and what I have to do is read some fitered data like for example name of the t...
https://stackoverflow.com/questions/76444291/how-to-convert-a-complex-datasheet-into-a-usabale-dataframe
python, dataframe, data-science
1,686,357,738
se_76436143
stackoverflow
DATA_SCIENCE
Transform Data Set Using Pandas
Transform Data Set Using Pandas I'm trying to transform how my data looks. I am trying to transform it from this: Feature 1 Feature 2 Feature 3 Feature 4 Target 10.2 0.5 2.1 7.8 15.3 11.5 0.7 1.8 7.0 16.2 9.8 0.6 2.2 8.5 14.5 ... ... ... ... ... 12.3 0.9 1.4 6.2 17.6 11.7 0.8 1.7 6.5 16.8 10.9 0.7 ...
https://stackoverflow.com/questions/76436143/transform-data-set-using-pandas
pandas, numpy, scikit-learn, data-science
1,686,264,141
se_57854124
stackoverflow
DATA_SCIENCE
str_extract_all returns a list but I want a column in a dataframe
str_extract_all returns a list but I want a column in a dataframe I'd like to use str_extract_all from the stringr package to extract digits from strings, and I'd like the output as numerics in a column of an existing dataframe. The problem is that the str_extract_all output's a list. UPDATE: My overall goal is to u...
https://stackoverflow.com/questions/57854124/str-extract-all-returns-a-list-but-i-want-a-column-in-a-dataframe
r, list, dataframe, data-science, stringr
1,568,032,255
se_76431885
stackoverflow
DATA_SCIENCE
Comparing data to a mapping file in R
Comparing data to a mapping file in R I am quite new in R and need help at a project for work. My company is switching from single role assignment to multi-role assigment in our system. The mapping file for two roles could look like this: old role new role teacher literature expert teacher caretaker teache...
https://stackoverflow.com/questions/76431885/comparing-data-to-a-mapping-file-in-r
r, compare, mapping, data-science
1,686,227,474
se_56697278
stackoverflow
DATA_SCIENCE
How can I use Correlation Coefficient to calculate change in variables
How can I use Correlation Coefficient to calculate change in variables I calculated a correlation of two dependent variables (size of plot/house vs cost), the correlation stands at 0.87. I want to use this index to measure the increase or decrease in cost if size is increased or decreased. Is it possible using correla...
https://stackoverflow.com/questions/56697278/how-can-i-use-correlation-coefficient-to-calculate-change-in-variables
statistics, data-science, correlation, pearson-correlation
1,561,094,454
se_76418309
stackoverflow
DATA_SCIENCE
Getting a ModuleNotFoundError with librosa
Getting a ModuleNotFoundError with librosa I am trying to load the audio files into the NumPy array using this code #%% import librosa import matplotlib.pyplot as plt import IPython.display as ipd import os, os.path import time import joblib import numpy as np #%% fname = 'archive\\Actor_01\\03-01-01-01-01-01-01.wav'...
https://stackoverflow.com/questions/76418309/getting-a-modulenotfounderror-with-librosa
python, python-3.x, data-science, librosa, modulenotfounderror
1,686,084,143
se_76397456
stackoverflow
DATA_SCIENCE
Why does the algorithm sometimes not behave as intended?
Why does the algorithm sometimes not behave as intended? we are currently working on a college project. We have been tasked to optimize the maintenance schedule for repairs on bikes from a bike sharing service. The bikes can only be rented from and returned to bike docking stations. We need to calculate the idle time,...
https://stackoverflow.com/questions/76397456/why-does-the-algorithm-sometimes-not-behave-as-intended
python, pandas, dataframe, algorithm, data-science
1,685,816,773
se_76426328
stackoverflow
DATA_SCIENCE
When using scikit-learn K-Means Clustering, how can you extract the centroids in original data domain?
When using scikit-learn K-Means Clustering, how can you extract the centroids in original data domain? I am using the sklearn KMeans k-means clustering algorithm. Before clustering, I normalize my data from [0,1] using scaler = MinMaxScaler() scaled_features = scaler.fit_transform(data) Now, I can run the K-means alg...
https://stackoverflow.com/questions/76426328/when-using-scikit-learn-k-means-clustering-how-can-you-extract-the-centroids-in
python, data-science, cluster-analysis, k-means
1,686,164,453
se_76425016
stackoverflow
DATA_SCIENCE
Anaconda new environment error: Paths don&#39;t have the same drive
Anaconda new environment error: Paths don&#39;t have the same drive I want to create a new environment in Anaconda, but I get an error: ValueError("Paths don't have the same drive") file "Q:\CI_Anlisten\Users\lkh004\Conda\lib\ntpath.py, line 804 in commonpath raise ValueError("Paths don't have the same drive)
https://stackoverflow.com/questions/76425016/anaconda-new-environment-error-paths-dont-have-the-same-drive
anaconda, data-science
1,686,152,537
se_76423496
stackoverflow
DATA_SCIENCE
Sum of column that resets to zero through out a process
Sum of column that resets to zero through out a process Is there an easy way to go about a total for a column that increments but can reset back to zero through out the dataset? I have started to go down the path of a for loop and keeping track of previous value if it isn't a zero and using multiple variables, but wan...
https://stackoverflow.com/questions/76423496/sum-of-column-that-resets-to-zero-through-out-a-process
python, pandas, dataframe, data-science
1,686,142,273
se_76415088
stackoverflow
DATA_SCIENCE
pandas series mark all the rows between two values
pandas series mark all the rows between two values I have a series ( a single col in a df) with 3 possible values: Stable, Increase, Decresae , and I want to mark all the areas between a Increase to the subsequent Decrease. So for the values: Stable Stable Stable Increase Increase Stable Stable Decrease Stable Increa...
https://stackoverflow.com/questions/76415088/pandas-series-mark-all-the-rows-between-two-values
pandas, dataframe, data-science, data-munging
1,686,057,467
se_68053674
stackoverflow
DATA_SCIENCE
opendatasoft. Analog for &#39;worldcitiespop&#39; dataset
opendatasoft. Analog for &#39;worldcitiespop&#39; dataset Who can recommend analog for dateset worldcitiespop on https://public.opendatasoft.com/? I use this data set early, but now, this data set is not available. Or may be, you know another open data source with public api.
https://stackoverflow.com/questions/68053674/opendatasoft-analog-for-worldcitiespop-dataset
data-science, opendatasoft
1,624,174,728
se_76392184
stackoverflow
DATA_SCIENCE
Create tables using OptBinning with custom bins
Create tables using OptBinning with custom bins I want to use the library optbinning to create tables with all the metrics, but under the assumption that I already have all the bins. I don't want to optimize the binning process, I just want the tables with my current bins. Despite the fact that I've found a "solution"...
https://stackoverflow.com/questions/76392184/create-tables-using-optbinning-with-custom-bins
python, data-science, analytics, optbinning
1,685,725,588
se_76400223
stackoverflow
DATA_SCIENCE
Getting error while parsing through driver.find_element()
Getting error while parsing through driver.find_element() I am getting below error even after correcting the query, I have tried all the given solutions but the error is still same. I am using 2 jupyter files, one is imported into the other and is used to extract data from the web Attached error screenshot and the cod...
https://stackoverflow.com/questions/76400223/getting-error-while-parsing-through-driver-find-element
python, selenium-webdriver, data-science, analysis
1,685,878,963
se_76401941
stackoverflow
DATA_SCIENCE
sentiment classification using doc2vec and LSTM Models
sentiment classification using doc2vec and LSTM Models I am building a text classification model based on sentiment analysis, the data contains text and sentiment[Positive, Natural, Negative] As first step, I clean the data and normalize it, then create doc2vec embedding: # Convert the data to TaggedDocument format fo...
https://stackoverflow.com/questions/76401941/sentiment-classification-using-doc2vec-and-lstm-models
python, nlp, data-science, lstm, doc2vec
1,685,904,224
se_76400397
stackoverflow
DATA_SCIENCE
Prevent tidymodels from turning numeric to chr
Prevent tidymodels from turning numeric to chr Apologies if this has been asked before, but I was unable to find the corresponding info. I am using the recipe from tidymodels and trying to create a model (eventually). As I prepped my this is effectively what it looked like (apologies, I can't include the actual data) ...
https://stackoverflow.com/questions/76400397/prevent-tidymodels-from-turning-numeric-to-chr
r, types, data-science, tidymodels, r-recipes
1,685,881,334
se_72675260
stackoverflow
DATA_SCIENCE
In the ROUGE metrics, what do the low, mid and high values mean?
In the ROUGE metrics, what do the low, mid and high values mean? The ROUGE metrics were introduced to "automatically determine the quality of a summary by comparing it to other (ideal) summaries created by humans" [1]. When calculating any ROUGE metric you get an AggregateScore object with 3 parameters: low, mid, high...
https://stackoverflow.com/questions/72675260/in-the-rouge-metrics-what-do-the-low-mid-and-high-values-mean
machine-learning, nlp, data-science, evaluation, summarization
1,655,626,221
se_76297649
stackoverflow
DATA_SCIENCE
Auto ARIMA in Python results in poor fitting prediction of trend
Auto ARIMA in Python results in poor fitting prediction of trend New to ARIMA and attempting to model a dataset in Python using auto ARIMA. I'm using auto-ARIMA as I believe it will be better at defining the values of p, d and q however the results are poor and I need some guidance. Please see my reproducible attempts...
https://stackoverflow.com/questions/76297649/auto-arima-in-python-results-in-poor-fitting-prediction-of-trend
python, data-science, prediction, arima, pmdarima
1,684,623,743
se_76298214
stackoverflow
DATA_SCIENCE
hoe to applied example in Sentiment analysis using textblob and naive bayes
hoe to applied example in Sentiment analysis using textblob and naive bayes Hi i am using amazon food dataset and my project about sentiment analysis i used TextBlob and naive Bayes models and after i get the accuracy for both i wants t to applied each model in example like this enter image description here this is th...
https://stackoverflow.com/questions/76298214/hoe-to-applied-example-in-sentiment-analysis-using-textblob-and-naive-bayes
dataset, data-science, sentiment-analysis, naivebayes, textblob
1,684,640,947
se_74424083
stackoverflow
DATA_SCIENCE
Federated learning weighted aggregation
Federated learning weighted aggregation I would like to add different weights to clients in Federated learning, so in the aggregation stage, each client has a different impact on the global model. For example: Client_1 has 2X impact Client_2 has X impact I am looking for suggestions to implement this approach.
https://stackoverflow.com/questions/74424083/federated-learning-weighted-aggregation
python, machine-learning, data-science, federated-learning
1,668,367,682
se_76375459
stackoverflow
DATA_SCIENCE
Generating means from bivariate gaussian distribution
Generating means from bivariate gaussian distribution I am reading the book "The elements of statistical learning" Ch 2 and on page 16 there is this line - 'First we generate 10 means m_k from a bivariate gaussian distribution N((1,0),I) and labelled BLUE. Similarly, 10 more were drawn from N((0,1),I) and labelled ORA...
https://stackoverflow.com/questions/76375459/generating-means-from-bivariate-gaussian-distribution
statistics, data-science, gaussian-process, gaussian-mixture-model
1,685,549,451
se_76361820
stackoverflow
DATA_SCIENCE
How to add a fixed value to the Y axis in Altair?
How to add a fixed value to the Y axis in Altair? I'm new to Altair and I'd like to add a two rule lines on the Y axis of a stock progression in my line chart. The DataFrame symbol_data has Date, Symbol, Name, Close, and I added another column "StdDev" which is the standard deviation for the entire data set. chart = a...
https://stackoverflow.com/questions/76361820/how-to-add-a-fixed-value-to-the-y-axis-in-altair
python, data-science, altair
1,685,424,469
se_76345909
stackoverflow
DATA_SCIENCE
Why I can&#39;t load dataset from seaborn
Why I can&#39;t load dataset from seaborn I am trying to load the dataset iris from seaborn in my spyder My code was simple: import seaborn as sns df = sns.load_dataset('iris') print(df) I am not getting output. I have tried in Jupiter notebook also, not getting any output What to do? I tried to load a dataset form s...
https://stackoverflow.com/questions/76345909/why-i-cant-load-dataset-from-seaborn
python, pandas, numpy, seaborn, data-science
1,685,174,462
se_76287760
stackoverflow
DATA_SCIENCE
What does &#39; ::Page{} &#39; do in R/RStudio?
What does &#39; ::Page{} &#39; do in R/RStudio? What does ::Page{} do in R/RStudio ? I'm studying Data Science through IBM certification course in coursera and the notes contain this line of code in all the code blocks and no explanation to what the "Page" function is doing #load ggplot package library(ggplot2) ::pa...
https://stackoverflow.com/questions/76287760/what-does-page-do-in-r-rstudio
r, data-science, data-analysis
1,684,488,501
se_67582613
stackoverflow
DATA_SCIENCE
Ramdom Oversampling with Stratified KFold - Value Error
Ramdom Oversampling with Stratified KFold - Value Error I have a data frame that looks like this. The data set is standardized using Standard scaler and dummy variables added for all categorical variables. It is now broken into train and test sets. amt gender city_pop birth_year distance 1...
https://stackoverflow.com/questions/67582613/ramdom-oversampling-with-stratified-kfold-value-error
python, machine-learning, data-science, k-fold, oversampling
1,621,326,665
se_61348016
stackoverflow
DATA_SCIENCE
What does DataFrame.select_dtypes(exclude=[&#39;object&#39;]) actually do?
What does DataFrame.select_dtypes(exclude=[&#39;object&#39;]) actually do? I'm learning data science with the help of an online course. While learning about filtering specific datatype from a DataFrame object in Pandas, I came across this line of code: df = df.select_dtypes(exclude=['object']) The purpose of the mo...
https://stackoverflow.com/questions/61348016/what-does-dataframe-select-dtypesexclude-object-actually-do
python, pandas, dataframe, data-science
1,587,485,477
se_75575549
stackoverflow
DATA_SCIENCE
Selection in the Dashboard to reflect in the drop-down in Tableau Dashboard
Selection in the Dashboard to reflect in the drop-down in Tableau Dashboard I have created the dashboard as the cascading filter(1 filter when selected affects the choice of other filters) which is working fine in attached Sample. But I want that --> when I click on the house h2 within the sheet , that should get ref...
https://stackoverflow.com/questions/75575549/selection-in-the-dashboard-to-reflect-in-the-drop-down-in-tableau-dashboard
data-science, tableau-api, tableau-desktop, tableau-prep
1,677,452,859
se_76304762
stackoverflow
DATA_SCIENCE
Load Teachable Machine Model in HTML and JavaScript Code
Load Teachable Machine Model in HTML and JavaScript Code I created a teachable machine audio project and uploaded it and used url in html code that is also provided by teachable machine and when I run in the browser it is working. But now I want to use downloaded model instead of uploaded url: what I tried: in place o...
https://stackoverflow.com/questions/76304762/load-teachable-machine-model-in-html-and-javascript-code
javascript, html, tensorflow, data-science, teachable-machine
1,684,747,836
se_76306008
stackoverflow
DATA_SCIENCE
How can I fix the &#39;arrays must be in the same length&#39; error in my Python web scraping code using Selenium and BeautifulSoup?
How can I fix the &#39;arrays must be in the same length&#39; error in my Python web scraping code using Selenium and BeautifulSoup? import bs4 import pandas as pd import re from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui impor...
https://stackoverflow.com/questions/76306008/how-can-i-fix-the-arrays-must-be-in-the-same-length-error-in-my-python-web-scr
python, selenium-webdriver, web-scraping, beautifulsoup, data-science
1,684,757,036
se_76298855
stackoverflow
DATA_SCIENCE
How does python apply filters to specific columns?
How does python apply filters to specific columns? The NumPy array data has a shape of (1000, ). More specifically, look at the code below: data = np.genfromtext("data.csv", delimiter=",", skip_header=1, names=("Score", "GPA", "Research")) I want to find out how many students have research experience. I apply this fi...
https://stackoverflow.com/questions/76298855/how-does-python-apply-filters-to-specific-columns
python, numpy, data-science
1,684,656,019
se_76292991
stackoverflow
DATA_SCIENCE
Data Treatment in concatenating some missing numbers
Data Treatment in concatenating some missing numbers When I passed the data to an Excel sheet, it cut of all the extra zeros that come before the numbers, but some of them actually started with zeros, so some rows are lacking zeros. I already cut the zeros off: import pandas as pd cpfs = pd.read_excel('cpfs.xlsx') cp...
https://stackoverflow.com/questions/76292991/data-treatment-in-concatenating-some-missing-numbers
python, pandas, data-science
1,684,539,666
se_76293954
stackoverflow
DATA_SCIENCE
how to extract director name from each row in dataset[&#39;crew&#39;]
how to extract director name from each row in dataset[&#39;crew&#39;] "[{'credit_id': '52fe4284c3a36847f8024f49', 'department': 'Directing', 'gender': 2, 'id': 7879, 'job': 'Director', 'name': 'John Lasseter', 'profile_path': '/7EdqiNbr4FRjIhKHyPPdFfEEEFG.jpg'} ]"" the dataset['crew'] looks like this.
https://stackoverflow.com/questions/76293954/how-to-extract-director-name-from-each-row-in-datasetcrew
python, data-science, recommendation-engine
1,684,566,452
se_71608038
stackoverflow
DATA_SCIENCE
How to Re-Write Lambda Function (via Pandas .apply() method) to Beat Famous &quot;ValueError: The truth value of a Series is ambiguous.&quot;?
How to Re-Write Lambda Function (via Pandas .apply() method) to Beat Famous &quot;ValueError: The truth value of a Series is ambiguous.&quot;? Edit: Solutions posted in this notebook. Special thanks to Étienne Célèry and ifly6! I am trying to figure out how to beat the feared error: ValueError: The truth value of a ...
https://stackoverflow.com/questions/71608038/how-to-re-write-lambda-function-via-pandas-apply-method-to-beat-famous-val
python, pandas, dataframe, lambda, data-science
1,648,148,319
se_76290625
stackoverflow
DATA_SCIENCE
Attempting to do emotion tagging
Attempting to do emotion tagging I'm currently working on a sentiment analysis. from transformers import pipeline sent_pipeline=pipeline('sentiment-analysis') This are my codes and the error its giving me is: Failed to import transformers.models.gpt2.modeling_gpt2 because of the following error (look up to see its ...
https://stackoverflow.com/questions/76290625/attempting-to-do-emotion-tagging
python, data-science, sentiment-analysis
1,684,511,264
se_76290407
stackoverflow
DATA_SCIENCE
Troubleshooting &#39;Notebook validation failed: data.cells&#39; error in Jupyter Notebook
Troubleshooting &#39;Notebook validation failed: data.cells&#39; error in Jupyter Notebook How to resolve the error "Notebook validation failed: data.cells[{data__cells_x}] must be valid exactly by one definition (0 matches found)" in Jupyter Notebook? How can I resolve the "Notebook validation failed: data.cells[{dat...
https://stackoverflow.com/questions/76290407/troubleshooting-notebook-validation-failed-data-cells-error-in-jupyter-notebo
python, error-handling, jupyter-notebook, data-science, data-analysis
1,684,509,545
se_76286721
stackoverflow
DATA_SCIENCE
Python can recognize header position and extract header info
Python can recognize header position and extract header info I have a csv file in which there are 3 or more headers in one csv file. I want python or pandas to be able to recognize the header position and extract the header info in the csv file. Here I give an example of a csv file that I have. "Level and Distortion",...
https://stackoverflow.com/questions/76286721/python-can-recognize-header-position-and-extract-header-info
python, pandas, data-science, visualization
1,684,479,678
se_76278352
stackoverflow
DATA_SCIENCE
MemoryError: Unable to allocate 31.1 GiB for an array with shape (21714, 100) and data type &lt;U3844
MemoryError: Unable to allocate 31.1 GiB for an array with shape (21714, 100) and data type &lt;U3844 I am training a BiLSTM CRF model and facing this error on all platform like jupyter notebook, colab, pycharm and even vscode in ubuntu 22.04. MemoryError Traceback (most recent call last...
https://stackoverflow.com/questions/76278352/memoryerror-unable-to-allocate-31-1-gib-for-an-array-with-shape-21714-100-an
python, pytorch, data-science, crf, bilstm
1,684,392,166
se_76280790
stackoverflow
DATA_SCIENCE
python function to display even numbers in the list from the user input list without using built in functions
python function to display even numbers in the list from the user input list without using built in functions I want user to input the values into the string, using the user defined function i want it to return the even numbers. I am trying to call filter_even() and pass evens as an argument. def filter_even(evens): ...
https://stackoverflow.com/questions/76280790/python-function-to-display-even-numbers-in-the-list-from-the-user-input-list-wit
python, data-science
1,684,412,341
se_76283470
stackoverflow
DATA_SCIENCE
How can I use Pandas or Openpyxl to classify a database in Excel based on supplier names?
How can I use Pandas or Openpyxl to classify a database in Excel based on supplier names? I want to classify a database in excel using Python (Pandas or Openpyxl), where I have the name of the supplier in the 1st column and I want to fill in the type in the 2nd column. But I need to identify the supplier as a string (...
https://stackoverflow.com/questions/76283470/how-can-i-use-pandas-or-openpyxl-to-classify-a-database-in-excel-based-on-suppli
python, data-science
1,684,433,805
se_76280180
stackoverflow
DATA_SCIENCE
Bard in react-native
Bard in react-native Can I implement Bard in react-native project? I searched on Google and chatGPT as well to find that can use BardAPI in react-native project, so I didn't find any article or any things related to this. Could anyone explain me the way of implement it?
https://stackoverflow.com/questions/76280180/bard-in-react-native
react-native, data-science, artificial-intelligence, alphabet, chatgpt-api
1,684,407,805
se_71101448
stackoverflow
DATA_SCIENCE
How to handle imbalanced data in general
How to handle imbalanced data in general I have been working on the case study where data is highly imbalanced. we have been taught we can handle the imbalanced data by either under sampling the majority class or over sampling the minority class. I wanted to ask if there is any other way/method that can be used to han...
https://stackoverflow.com/questions/71101448/how-to-handle-imbalanced-data-in-general
machine-learning, data-science, imbalanced-data
1,644,761,489
se_58897964
stackoverflow
DATA_SCIENCE
JupyterLab vs JupyterNotebook
JupyterLab vs JupyterNotebook Hello everyone on Stack Overflow. Today, I would like to ask something very different question. I am currently working as a data scientist, and I work alot on JupyterLab/Notebook. Couple of my co-workers use Notebook instead of JupyterLab. It seems like there are not much difference bet...
https://stackoverflow.com/questions/58897964/jupyterlab-vs-jupyternotebook
jupyter-notebook, anaconda, data-science, jupyter-lab
1,573,970,583
se_69088218
stackoverflow
DATA_SCIENCE
Google Ads API: creating an IpBlockInfo instance
Google Ads API: creating an IpBlockInfo instance I need to modify the blocked IP addresses for a given campaign using the Google Ads API call (version v8). I figured that to add blocked IPs to a given campaign I must create a new campaign criterion, not update an existing one, using the MutateCampaignCriterion endpoin...
https://stackoverflow.com/questions/69088218/google-ads-api-creating-an-ipblockinfo-instance
python, data-science, etl, google-ads-api, ip-blocking
1,631,017,537
se_69302224
stackoverflow
DATA_SCIENCE
How to One Hot Encode a Dataframe Column in Python?
How to One Hot Encode a Dataframe Column in Python? I'm trying to convert a column Dataframe with One Hot Encoder with this code. from sklearn.preprocessing import OneHotEncoder df['label'] = OneHotEncoder().fit(df['label']).toarray() This is the traceback ValueError: Expected 2D array, got 1D array instead: array=...
https://stackoverflow.com/questions/69302224/how-to-one-hot-encode-a-dataframe-column-in-python
python, machine-learning, scikit-learn, data-science, one-hot-encoding
1,632,408,341
se_74761900
stackoverflow
DATA_SCIENCE
Error message: Error in data$CVDSTRK3 : object of type &#39;closure&#39; is not subsettable
Error message: Error in data$CVDSTRK3 : object of type &#39;closure&#39; is not subsettable Q<-patients_with_stroke <- data[data$CVDSTRK3==1,] max_numwomen<-max(patients_with_stroke$NUMWOMEN, na.rm = TRUE) max_numwomen Please help. I tried to find the highest value for number of adult women in the household where som...
https://stackoverflow.com/questions/74761900/error-message-error-in-datacvdstrk3-object-of-type-closure-is-not-subsetta
r, data-science, data-analysis
1,670,771,154
se_76253753
stackoverflow
DATA_SCIENCE
Combining strings which have been altered
Combining strings which have been altered I have the following three strings: "A randomized, prospective study of [intervention]endometrial resection[intervention] to prevent recurrent endometrial polyps in women with breast cancer receiving tamoxifen. To assess the role of endometrial resection in preventing recurren...
https://stackoverflow.com/questions/76253753/combining-strings-which-have-been-altered
python, string, data-science
1,684,151,229
se_76236925
stackoverflow
DATA_SCIENCE
WIth wordcloud, it says &#39;only Truetypefonts supported&#39; (&#39;despite adding the right path), or &#39;TypeError: argument of type &#39;int&#39; is not iterable
WIth wordcloud, it says &#39;only Truetypefonts supported&#39; (&#39;despite adding the right path), or &#39;TypeError: argument of type &#39;int&#39; is not iterable I wanted to see if I could generate a wordcloud on my fake dataframe, but I'm running in quite some trouble. I used the code from this website: https://...
https://stackoverflow.com/questions/76236925/with-wordcloud-it-says-only-truetypefonts-supported-despite-adding-the-righ
python, pip, python-imaging-library, data-science, word-cloud
1,683,898,991
se_76246837
stackoverflow
DATA_SCIENCE
How do I drop and change dtype in a Pipeline with sklearn?
How do I drop and change dtype in a Pipeline with sklearn? I have some scraped data that needs some cleaning. After the cleaning, I want to create a "numerical and categorical pipelines" inside a ColumnTransformer such as: categorical_cols = df.select_dtypes(include='object').columns numerical_cols = df.select_dtypes(...
https://stackoverflow.com/questions/76246837/how-do-i-drop-and-change-dtype-in-a-pipeline-with-sklearn
python, machine-learning, scikit-learn, data-science
1,684,057,954
se_76244605
stackoverflow
DATA_SCIENCE
How to save the changes after a loop in python?
How to save the changes after a loop in python? for i in data['test preparation course']: if i == 'none': i = None here, I'm trying to convert 'none' string with None values in python, and it went well. I just want to activate the changes on the dataset
https://stackoverflow.com/questions/76244605/how-to-save-the-changes-after-a-loop-in-python
python, pandas, data-science, data-analysis, data-cleaning
1,684,007,305
se_76234776
stackoverflow
DATA_SCIENCE
Creating a for loop of pie charts
Creating a for loop of pie charts I am trying to create a for loop which loops over all of teh data values of my pandas dataframe and creates a pie chart with fast and flow charging stations as hue for each year. It should also have the percentage of the total charging stations for each year. region powertrain y...
https://stackoverflow.com/questions/76234776/creating-a-for-loop-of-pie-charts
python, for-loop, data-science
1,683,882,589
se_76233716
stackoverflow
DATA_SCIENCE
Groupby Mean not working on titanic dataset in Python
Groupby Mean not working on titanic dataset in Python I am using titanic dataset and tring to run the groupby command but its not working as shown on countless tutorials online. I have named my dataframe as ks_cl. Here is the command I executed in VScode: ks_cl.groupby(['sex']).mean() This is the output: NotImplemente...
https://stackoverflow.com/questions/76233716/groupby-mean-not-working-on-titanic-dataset-in-python
python, pandas, dataframe, data-science
1,683,873,546
se_76232426
stackoverflow
DATA_SCIENCE
How to generate random variables from a probability density function/ probability mass function
How to generate random variables from a probability density function/ probability mass function I am trying simulate random arrival times for cars that will park in a small parking lot. I want to use a random generator to create random parking events. I am not sure if numpy is the correct library for this job. Example...
https://stackoverflow.com/questions/76232426/how-to-generate-random-variables-from-a-probability-density-function-probabilit
python, numpy, scipy, data-science, probability-density
1,683,851,570
se_48981550
stackoverflow
DATA_SCIENCE
What is the best way of Under sampling in R
What is the best way of Under sampling in R I have a dataset with attribute A,B, C. C is a factor with 2 labels zz and z. number of (z) > number of (zz), I want to under sample my data set so that in the new data has same no of zz and z values. Can't use any external package for this. Best if can be done using sample ...
https://stackoverflow.com/questions/48981550/what-is-the-best-way-of-under-sampling-in-r
r, random, analytics, data-science
1,519,619,960
se_76226649
stackoverflow
DATA_SCIENCE
Ordering independent variables in relation to the dependent variable
Ordering independent variables in relation to the dependent variable I am building a regression model with some of the following variables: Dependent variable named 'Churned'. This contains either 1 or 0. 1 if they churned and 0 if they did not. Independent variable named 'How happy with the service'. This is on a s...
https://stackoverflow.com/questions/76226649/ordering-independent-variables-in-relation-to-the-dependent-variable
data-science, linear-regression, logistic-regression
1,683,800,996
se_66917445
stackoverflow
DATA_SCIENCE
Complete Cryptocurrencies Data
Complete Cryptocurrencies Data I am working on cryptocurrencies blockchain data and I want data from the beginning of the time of that particular cryptocurrency. Is there any way to download complete block data in the Postgresql file? https://blockchair.com/dumps is although offering this but they limit the download s...
https://stackoverflow.com/questions/66917445/complete-cryptocurrencies-data
data-science, blockchain, data-analysis, bitcoin, cryptocurrency
1,617,356,831
se_76219962
stackoverflow
DATA_SCIENCE
How to read a column and apply a function to each cell as a tuple?
How to read a column and apply a function to each cell as a tuple? I'm trying to analyze a database with coordinates (X,Y). I need to read each data in that column and classify it as either North or South if it's "Y" or East or West if it's "X". So basically what I want to do is read each data in that column and apply...
https://stackoverflow.com/questions/76219962/how-to-read-a-column-and-apply-a-function-to-each-cell-as-a-tuple
python, pandas, database, dataframe, data-science
1,683,730,839
se_76213798
stackoverflow
DATA_SCIENCE
What is different between Jupyterhub and simple Jupyter?
What is different between Jupyterhub and simple Jupyter? What is differents between Jupyterhub and simple Jupyter? I want you describe in more detail
https://stackoverflow.com/questions/76213798/what-is-different-between-jupyterhub-and-simple-jupyter
data-science, artificial-intelligence, devops
1,683,671,857
se_68282541
stackoverflow
DATA_SCIENCE
Python script iterates over whole folder but skips files in the folder
Python script iterates over whole folder but skips files in the folder I tried running the following code. The code should read hdf5 files from a directory and create for every hdf5 file a png and a txt file with the same name (btw. I need it as input for the CNN YOLO). The code does what I described but only for 20 i...
https://stackoverflow.com/questions/68282541/python-script-iterates-over-whole-folder-but-skips-files-in-the-folder
python, data-science
1,625,646,395
se_76205150
stackoverflow
DATA_SCIENCE
Trouble creating a conda environment
Trouble creating a conda environment I am trying to create a conda environment but am running into a lot of trouble. This is my first time using conda (with the intention of using Jupyter notebooks for the first time). Using macOS, I start by typing into the terminal: conda create --name test_name scikit-learn pandas ...
https://stackoverflow.com/questions/76205150/trouble-creating-a-conda-environment
jupyter-notebook, anaconda, data-science, jupyter, conda
1,683,592,192
se_45221940
stackoverflow
DATA_SCIENCE
Creating train/test/val split with StratifiedKFold
Creating train/test/val split with StratifiedKFold I'm trying to use StratifiedKFold to create train/test/val splits for use in a non-sklearn machine learning work flow. So, the DataFrame needs to be split and then stay that way. I'm trying to do it like the following, using .values because I'm passing pandas DataFra...
https://stackoverflow.com/questions/45221940/creating-train-test-val-split-with-stratifiedkfold
python, pandas, scikit-learn, cross-validation, data-science
1,500,573,242
se_76174413
stackoverflow
DATA_SCIENCE
Collapse rows by common variable of list
Collapse rows by common variable of list I want to collapse the rows of dataframe to create the orthologe group of each othologe and its corresponding genes. For example: Column A Column B Ortho1 gene1 Ortho2 gene2, gene3 Ortho3 gene4, gene5, gene6 Ortho4 gene5, gene6 Ortho5 gene6, gene7 Ortho6 gene1...
https://stackoverflow.com/questions/76174413/collapse-rows-by-common-variable-of-list
r, dataframe, tidyverse, data-science, bioinformatics
1,683,211,144
se_76198692
stackoverflow
DATA_SCIENCE
How can i see all parameters of a function in Pandas?
How can i see all parameters of a function in Pandas? dir(pd) shows only some of pandas functions not all, but in documentation there are a lot of them that are quite handy. Is there any way to see list of all functions and particularly their parameters with some code? Thanks
https://stackoverflow.com/questions/76198692/how-can-i-see-all-parameters-of-a-function-in-pandas
python, pandas, function, parameters, data-science
1,683,533,984
se_76204274
stackoverflow
DATA_SCIENCE
Index a different range of indicies from each row of numpy array
Index a different range of indicies from each row of numpy array I have two arrays of incidies with shape m. I need to take the mean of the values inbetween the indicies from an array with shape m x n. Can this be done without iterating through each row? What is the fastest way to do this? idx0 = np.array([1, 3, 2, 5]...
https://stackoverflow.com/questions/76204274/index-a-different-range-of-indicies-from-each-row-of-numpy-array
python, numpy, data-science
1,683,579,022
se_75785140
stackoverflow
DATA_SCIENCE
right way to use simple imputer?
right way to use simple imputer? I have a test- and a train-dataset with nan-values. I would like to use simple imputer in order to deal with them using the following code. #numerical values imp= SImp(strategy= 'median') #or 'mean', 'median', 'most_frequent' my_df.loc[:, num_cols_nan]= imp.fit_transform(def_df.loc[:,...
https://stackoverflow.com/questions/75785140/right-way-to-use-simple-imputer
python, data-science, imputation
1,679,262,653
se_71974438
stackoverflow
DATA_SCIENCE
Training New AutoTokenizer Hugging Face
Training New AutoTokenizer Hugging Face Getting this error: AttributeError: 'GPT2Tokenizer' object has no attribute 'train_new_from_iterator' Very similar to hugging face documentation. I changed the input and that's it (shouldn't affect it). It worked once. Came back to it 2 hrs later and it doesn't... nothing was c...
https://stackoverflow.com/questions/71974438/training-new-autotokenizer-hugging-face
python, nlp, data-science, huggingface-transformers, transformer-model
1,650,660,236
se_76078066
stackoverflow
DATA_SCIENCE
Why am I getting this error when trying to use snscraper?
Why am I getting this error when trying to use snscraper? The following code: import time import pandas as pd # pip install snscrape !pip install snscrape # Pull Twitter data using SNScrape import snscrape.modules.twitter as sntwitter scraper = sntwitter.TwitterSearchScraper("#python") for tweet in scraper.get_ite...
https://stackoverflow.com/questions/76078066/why-am-i-getting-this-error-when-trying-to-use-snscraper
python, pandas, data-science
1,682,138,772
se_76189409
stackoverflow
DATA_SCIENCE
How to resampling o multidimensional event without losing information
How to resampling o multidimensional event without losing information I have a dataset representing a time series The time series has 165 events Each unique event has 15 rows, FX1, FX2, … FX15 The time between each row is 1 minute so one event takes 15 minutes Each row has 6 features F1,F2,F3,T1,T2,T3 All values are n...
https://stackoverflow.com/questions/76189409/how-to-resampling-o-multidimensional-event-without-losing-information
pandas, machine-learning, time-series, data-science, artificial-intelligence
1,683,383,106
se_76191151
stackoverflow
DATA_SCIENCE
Is there a Python function that allows me to sum the last goals of a team in a dataframe?
Is there a Python function that allows me to sum the last goals of a team in a dataframe? I'm solo learning football data science, and want to analyse some things in the turkish league. Now I'm trying to make some analyses from the past 5 games of both teams from the upcoming games. First I've already made a dataframe...
https://stackoverflow.com/questions/76191151/is-there-a-python-function-that-allows-me-to-sum-the-last-goals-of-a-team-in-a-d
python, pandas, data-science
1,683,407,293
se_76190848
stackoverflow
DATA_SCIENCE
How can I double unpivot data like in this example in SQL?
How can I double unpivot data like in this example in SQL? I saw sometimes you can use a cross apply, but I feel it won't work in this case as I have 10 columns for "Days" (for 10 years) and 10 columns for "Discharges" (for 10 years).....so I need this pivoted into 10 different row per zip and age group. Starting outp...
https://stackoverflow.com/questions/76190848/how-can-i-double-unpivot-data-like-in-this-example-in-sql
sql, sql-server, database, data-science, ssms
1,683,402,915
se_76187352
stackoverflow
DATA_SCIENCE
How to resolve &#39;AttributeError&#39; in &#39;yfinance&#39; library while getting historical stock data for TSLA?
How to resolve &#39;AttributeError&#39; in &#39;yfinance&#39; library while getting historical stock data for TSLA? I'm trying to retrieve the historical stock data for TSLA using the yfinance library in Python and converting the index to a pandas DatetimeIndex in the UTC timezone. This is my code: import yfinance as ...
https://stackoverflow.com/questions/76187352/how-to-resolve-attributeerror-in-yfinance-library-while-getting-historical-s
python-3.x, jupyter-notebook, data-science
1,683,352,327
se_76183889
stackoverflow
DATA_SCIENCE
Dataframe.groupby function not working correctly on Jupyter notebook
Dataframe.groupby function not working correctly on Jupyter notebook I have initialized a df like: import numpy as np import pandas as pd df = pd.read_csv('pokemon_data.csv') df Running df.info() for this dataset: <class 'pandas.core.frame.DataFrame'> RangeIndex: 800 entries, 0 to 799 Data columns (total 12 col...
https://stackoverflow.com/questions/76183889/dataframe-groupby-function-not-working-correctly-on-jupyter-notebook
python, pandas, group-by, jupyter-notebook, data-science
1,683,301,403
se_76184967
stackoverflow
DATA_SCIENCE
Efficiently iterating over a list to extract count for multiple variables
Efficiently iterating over a list to extract count for multiple variables I have a dataset of medical insurance variables, and am interested in understanding how the proportion of smokers ('yes', 'no') differ between regions ('northwest', 'northeast', 'southwest', 'southeast'). I have used a for loop to iterate over e...
https://stackoverflow.com/questions/76184967/efficiently-iterating-over-a-list-to-extract-count-for-multiple-variables
python, for-loop, data-science, analysis
1,683,310,801
se_75464638
stackoverflow
DATA_SCIENCE
How to delete specific cells in a pandas dataframe giving some conditions?
How to delete specific cells in a pandas dataframe giving some conditions? I want to clear the contents of the first two cells in location for every first 2 duplicates in last name. For eg: i want to clear out the 1st 2 location occurances for Balchuinas and only keep the 3rd one. Same goes for London and Fleck. I ONL...
https://stackoverflow.com/questions/75464638/how-to-delete-specific-cells-in-a-pandas-dataframe-giving-some-conditions
python, pandas, data-science, data-analysis
1,676,489,545
se_76177042
stackoverflow
DATA_SCIENCE
Pandas Correlation Matrices?
Pandas Correlation Matrices? I have a large DataFrame; the values of all columns are floating point numbers, and the indices are of type DatetimeIndex. For example, here is the first part of my DataFrame: col0 col1 col2 col3 col4 ... 2035-10-30 1.0 1.0 1.0 1.0 1.0 ... 2035-10-31 1.0 1.0 1.0 1.0 ...
https://stackoverflow.com/questions/76177042/pandas-correlation-matrices
python, pandas, dataframe, data-science
1,683,231,000
se_76168726
stackoverflow
DATA_SCIENCE
I ran a command that was supposed to show me the data about my object detection ai but i get an error that i can&#39;t solve
I ran a command that was supposed to show me the data about my object detection ai but i get an error that i can&#39;t solve basically i have this command: python Tensorflow\models\research\object_detection\model_main_tf2.py --model_dir=Tensorflow\workspace\models\my_ssd_mobnet --pipeline_config_path=Tensorflow\worksp...
https://stackoverflow.com/questions/76168726/i-ran-a-command-that-was-supposed-to-show-me-the-data-about-my-object-detection
python, data-science, object-detection, python-unicode
1,683,158,966
se_76157596
stackoverflow
DATA_SCIENCE
Scaling a dataset in matplotlib on x and y axis relative to another dataset?
Scaling a dataset in matplotlib on x and y axis relative to another dataset? I am trying to scale two different sets of data to be visually equivalent. Green data set has extreme Y values and significantly more data points. Hence Orange data set falls flat and short. What functions exist that allow me to scale them eq...
https://stackoverflow.com/questions/76157596/scaling-a-dataset-in-matplotlib-on-x-and-y-axis-relative-to-another-dataset
python, matplotlib, plot, graph, data-science
1,683,049,922
se_76147574
stackoverflow
DATA_SCIENCE
Complex problem: Error with organising information on a very large dataset
Complex problem: Error with organising information on a very large dataset I have two pandas dataframes. The first is called df that has a list of records of flights (saved in different columns: stand, acreg, start_datetime, and end_datetime). For each record, there are many values in the column "fpu_A" in a second Da...
https://stackoverflow.com/questions/76147574/complex-problem-error-with-organising-information-on-a-very-large-dataset
python, pandas, data-science, large-data, rolling-computation
1,682,950,003
se_76159014
stackoverflow
DATA_SCIENCE
pandas group memory usage reduction
pandas group memory usage reduction Hello i have some code that is utilizing a high amount of memory regressor_df is a df that has over 14 million elements. when i remove the location from the group by the amount of ram needed to process goes down by about 26gb. how can i run this group by more efficiently or have the...
https://stackoverflow.com/questions/76159014/pandas-group-memory-usage-reduction
python, pandas, data-science
1,683,063,115
se_76139392
stackoverflow
DATA_SCIENCE
R function How do I delete certain rows?
R function How do I delete certain rows? I have a data be like this: Each same patient has several records at different ages. How can I just keep records of each patient that with their oldest ages in the data? Thank you! oldest_age <- aggregate(AGE~RANDID,data=df,max) This was the way I did, but it only kept the a...
https://stackoverflow.com/questions/76139392/r-function-how-do-i-delete-certain-rows
r, data-science
1,682,825,239
se_76144622
stackoverflow
DATA_SCIENCE
What does random_state = 0 do when used as an argument to the SVC function?
What does random_state = 0 do when used as an argument to the SVC function? I understand what random_state = 0 does in train test split and other applications. However, I do not understand it in the context of Support Vector machines/support vector classifiers. I do not understand what is it setting exactly or how it ...
https://stackoverflow.com/questions/76144622/what-does-random-state-0-do-when-used-as-an-argument-to-the-svc-function
python, python-3.x, data-science, svm
1,682,912,778
se_76142614
stackoverflow
DATA_SCIENCE
AttributeError: module &#39;keras.preprocessing.sequence&#39; has no attribute &#39;pad_sequences&#39;
AttributeError: module &#39;keras.preprocessing.sequence&#39; has no attribute &#39;pad_sequences&#39; I'm getting this error : AttributeError: module 'keras.preprocessing.sequence' has no attribute 'pad_sequences' import keras from keras import preprocessing from keras.utils import pad_sequences tokenizer = text.Tok...
https://stackoverflow.com/questions/76142614/attributeerror-module-keras-preprocessing-sequence-has-no-attribute-pad-sequ
keras, nlp, data-science, tokenize, data-preprocessing
1,682,875,637
se_76138634
stackoverflow
DATA_SCIENCE
How to cherry pick tuned parameters after workflow_map
How to cherry pick tuned parameters after workflow_map I've tuned succesfully several models using {tidymodels} and {workflow_set}. However, when testing the validation dataset with tune::last_fit(), the parameters obtained by tune::select_best don't behave well. This makes me want to manually test other sets of param...
https://stackoverflow.com/questions/76138634/how-to-cherry-pick-tuned-parameters-after-workflow-map
r, machine-learning, tidyverse, data-science, tidymodels
1,682,805,423
se_76141538
stackoverflow
DATA_SCIENCE
What would happen if I do a self join of a dataframe and also apply broadcasting?
What would happen if I do a self join of a dataframe and also apply broadcasting? What will happen if I join a dataframe/RDD/dataset with itself, i.e. do a self-join, and do a broadcast of the same dataframe/RDD/dataset in the operation? The broadcast and self-join can't work together optimally.
https://stackoverflow.com/questions/76141538/what-would-happen-if-i-do-a-self-join-of-a-dataframe-and-also-apply-broadcasting
apache-spark, pyspark, data-science, self-join
1,682,861,762
se_76135165
stackoverflow
DATA_SCIENCE
How do I encode location data for linear regression in Python?
How do I encode location data for linear regression in Python? I am doing a beginner project to predict house prices. I have one category called 'city' with values such as Boston, Detroit, NY, etc. If I use One Hot Encoder I will end up with a very huge dataset because there are around 100 unique values. But I am unsu...
https://stackoverflow.com/questions/76135165/how-do-i-encode-location-data-for-linear-regression-in-python
python, machine-learning, data-science, linear-regression
1,682,755,547
se_76135034
stackoverflow
DATA_SCIENCE
fillna not working in pandas for a specific column
fillna not working in pandas for a specific column i asigned TEMPERATURE column of NaN value to be zero but not working properly all other columns working properly but this is not senter image description here expecting to be temperature column nan values to be 0 but not working enter image description here
https://stackoverflow.com/questions/76135034/fillna-not-working-in-pandas-for-a-specific-column
python, pandas, jupyter-notebook, data-science, nan
1,682,753,494
se_76122001
stackoverflow
DATA_SCIENCE
Why is my program closing when I try to use a second function after the initial one?
Why is my program closing when I try to use a second function after the initial one? I am creating a GUI for my co worker to help them with their reporting processes for our genetic testing. I'm having an issue I cant seem to figure out though. The workflow is set in the order of tabs in the program. If I use the web...
https://stackoverflow.com/questions/76122001/why-is-my-program-closing-when-i-try-to-use-a-second-function-after-the-initial
python, user-interface, data-science, bioinformatics, pysimplegui
1,682,608,298
se_76097942
stackoverflow
DATA_SCIENCE
why Train/Test-split in ML?
why Train/Test-split in ML? I can't understand why we need to split dataset in machine learning. And why this train-test-split algorithm gives four parameters(x_train, x_test, y_train, y_test)? I see many videos and read some blogs, they explain a lot of reasons. No one agree with each other. Is there any common reaso...
https://stackoverflow.com/questions/76097942/why-train-test-split-in-ml
machine-learning, scikit-learn, data-science, train-test-split
1,682,401,640
se_71621791
stackoverflow
DATA_SCIENCE
Avoid X axis labels repetition in Altair chart
Avoid X axis labels repetition in Altair chart So I got this chart which displays a time series in X.Axis using yearmonth('date'):T. The thing is, it duplicates the labels to fill the spaces, but I don't want that behaviour. I'd like a single label each time. How can I do this? example df: ID date total 3...
https://stackoverflow.com/questions/71621791/avoid-x-axis-labels-repetition-in-altair-chart
python, data-science, data-visualization, altair
1,648,234,180
se_76122528
stackoverflow
DATA_SCIENCE
How to cluster a massive amount of data that doesn&#39;t fit into memory?
How to cluster a massive amount of data that doesn&#39;t fit into memory? I have 30 files, each is a dictionary with about 1M keys that map to embeddings: file_1 = {key_1: some_array, key_2: some_array ...} file_2 = {key_13: some_array, key_21: some_array ...} ... file_30 = {key_123: some_array, key_9: some_array ....
https://stackoverflow.com/questions/76122528/how-to-cluster-a-massive-amount-of-data-that-doesnt-fit-into-memory
python, machine-learning, data-science, cluster-analysis, data-analysis
1,682,611,677