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_75444857 | stackoverflow | DATA_SCIENCE | Python: duplicate one row into two rows and make changes | Python: duplicate one row into two rows and make changes
I have this pandas dataframe with two columns and the index is shown too.
Name Membership Specs
0 Adam NORMAL 170
1 James NORMAL 170
2 Michael ADMINCOORDINATOR 170
3 Lina NORMAL 170
4 Alexey ADMINCOOR... | https://stackoverflow.com/questions/75444857/python-duplicate-one-row-into-two-rows-and-make-changes | python, pandas, dataframe, data-science | 1,676,361,532 |
se_74309426 | stackoverflow | DATA_SCIENCE | Error with the graphing library: "module 'graphing' has no attribute 'scatter_2D'" | Error with the graphing library: "module 'graphing' has no attribute 'scatter_2D'"
Code:
import graphing
graphing.scatter_2D(dataset, label_x="harness_size",
label_y="boot_size",
trendline=lambda x: fitted_model.params[1] * ... | https://stackoverflow.com/questions/74309426/error-with-the-graphing-library-module-graphing-has-no-attribute-scatter-2d | python, data-science, graphing | 1,667,508,750 |
se_75418010 | stackoverflow | DATA_SCIENCE | Measure similarity of objects over a period of time | Measure similarity of objects over a period of time
I've got a dataset that has monthly metrics for different stores. Each store has three monthly (Total sales, customers and transaction count), my task is over a year I need to find the store that most closely matches a specific test store (Ex: Store 77).
Therefore ov... | https://stackoverflow.com/questions/75418010/measure-similarity-of-objects-over-a-period-of-time | math, data-science, data-analysis, similarity | 1,676,087,788 |
se_75439141 | stackoverflow | DATA_SCIENCE | how to build a custom scaler with sklearn standard scaler | how to build a custom scaler with sklearn standard scaler
i wanted to only standardize my non dummy columns and i used this code to solve my problem :
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.preprocessing import StandardScaler
class CustomScaler(BaseEstimator,TransformerMixin):
... | https://stackoverflow.com/questions/75439141/how-to-build-a-custom-scaler-with-sklearn-standard-scaler | python, scikit-learn, data-science, typeerror, logistic-regression | 1,676,308,568 |
se_75437639 | stackoverflow | DATA_SCIENCE | Code works until I put it into a function | Code works until I put it into a function
I am writing a function to pull data from an excel file
output = pd.Dataframe()
def get_help(sheet,head,file):
tmp_df = pd.read_excel(file,sheet_name='Cover')
tmp_df = tmp_df.dropna(how='all')
tmp_df = tmp_df.dropna(axis=1,how='all')
fnf = tmp_df.iloc[3,0]
... | https://stackoverflow.com/questions/75437639/code-works-until-i-put-it-into-a-function | python, pandas, data-science, data-wrangling | 1,676,300,679 |
se_75411915 | stackoverflow | DATA_SCIENCE | Collapse together pandas row that respect a list of conditions | Collapse together pandas row that respect a list of conditions
So, i have a dataframe of the type:
Doc
String
A
abc
A
def
A
ghi
B
jkl
B
mnop
B
qrst
B
uv
What I'm trying to do is to merge/collpase rows according to a two conditions:
they must be from the same document
they should be merged toge... | https://stackoverflow.com/questions/75411915/collapse-together-pandas-row-that-respect-a-list-of-conditions | python, pandas, data-science, sentence | 1,676,036,374 |
se_75407603 | stackoverflow | DATA_SCIENCE | Problems with fit_transform/transform in category_encoder | Problems with fit_transform/transform in category_encoder
I encountered such a problem when transforming the OrdinalEncoder I get an error
It says that my cols does not list all the columns I need for X_train
I hope to get your help.
I tried to submit my code to the Kaggle contest, but I got an error.
In Jupyter every... | https://stackoverflow.com/questions/75407603/problems-with-fit-transform-transform-in-category-encoder | python, data-science | 1,676,010,328 |
se_75415674 | stackoverflow | DATA_SCIENCE | How to format the string values without space to datetime in python? | How to format the string values without space to datetime in python?
i have a pandas df:
Date
0
20221101
1
20220510
2
20230102
The dates are string and are formatted as %Y%M%D
I want to format the entire column to %D%M%Y. Like this:
Date
0
01-11-2022
1
10-05-2022
2
02-01-2023
I tried ... | https://stackoverflow.com/questions/75415674/how-to-format-the-string-values-without-space-to-datetime-in-python | python, pandas, datetime, formatting, data-science | 1,676,059,563 |
se_75413805 | stackoverflow | DATA_SCIENCE | Colours overlapping in bar graph | Colours overlapping in bar graph
I'm trying to use different colours for representing different categories of species in the bar graph in iris dataset but all the colours are getting overlapped on every bar of the graph
The bar graph
I used this code
fig,axes=plt.subplots(2,2,figsize=(8,8))
c=['red','green','orange']... | https://stackoverflow.com/questions/75413805/colours-overlapping-in-bar-graph | python, matplotlib, jupyter-notebook, data-science, visualization | 1,676,047,035 |
se_75405542 | stackoverflow | DATA_SCIENCE | How can I make sure my constraint can operate mathematically with the LpVariable? | How can I make sure my constraint can operate mathematically with the LpVariable?
I am trying to use the pulb libraries classes to solve a LP-Problem. I am having problems implementing the constraint into my code.
After importing the relevant classes and reading from my CSV file I wrote:
prob = pulp.LpProblem("Optimal... | https://stackoverflow.com/questions/75405542/how-can-i-make-sure-my-constraint-can-operate-mathematically-with-the-lpvariable | python, data-science, linear-programming, operands | 1,675,985,553 |
se_75394067 | stackoverflow | DATA_SCIENCE | Getting SettingWithCopyWarning in case of column drop or modify for pandas dataframe | Getting SettingWithCopyWarning in case of column drop or modify for pandas dataframe
From the sample dataset 'iris', i have created a dataframe df as follows :
import seaborn as sns
df = sns.load_dataset('iris')
From this i created another dataframe d2 & from the '_is_view' flag, i can see that the d2 is created as a... | https://stackoverflow.com/questions/75394067/getting-settingwithcopywarning-in-case-of-column-drop-or-modify-for-pandas-dataf | pandas, dataframe, machine-learning, data-science | 1,675,915,208 |
se_75381879 | stackoverflow | DATA_SCIENCE | Flask App working locally but not working on local docker | Flask App working locally but not working on local docker
The app is running locally but when i build docker image and try to run the app from local docker then the browser shows the following error:
This site can’t be reached http://172.17.0.2:8080/ is unreachable.
ERR_ADDRESS_UNREACHABLE and also taking too long to ... | https://stackoverflow.com/questions/75381879/flask-app-working-locally-but-not-working-on-local-docker | python-3.x, data-science | 1,675,836,007 |
se_75401163 | stackoverflow | DATA_SCIENCE | SQL: Efficient distinct count by category over moving date window | SQL: Efficient distinct count by category over moving date window
The problem
I have a large amount of card transaction data in SQL tables (SQL Server). Each row has the following information:
Main table
TxnDate
UserID
SpendCategory
Amount
AgeGroup
01/01/2018
ID1
Category1
100
18-29
02/03/2019
ID2
Category2
... | https://stackoverflow.com/questions/75401163/sql-efficient-distinct-count-by-category-over-moving-date-window | sql, sql-server, performance, data-science | 1,675,958,124 |
se_75312663 | stackoverflow | DATA_SCIENCE | Can I use JupyterHub to authorise users' access to remote hosted lab instances? | Can I use JupyterHub to authorise users' access to remote hosted lab instances?
Current state
I'm currently setting up a Datascience/ML Environment for my research team.
I use a Synology NAS as a reverse Proxy to forward requests to our workstations. These host several different Jupyter Labs for projects (located ... | https://stackoverflow.com/questions/75312663/can-i-use-jupyterhub-to-authorise-users-access-to-remote-hosted-lab-instances | python, network-programming, data-science, jupyter, jupyterhub | 1,675,266,061 |
se_75404964 | stackoverflow | DATA_SCIENCE | how to convert hyphen to minus for exponent in matplotlib? | how to convert hyphen to minus for exponent in matplotlib?
Consider the following example
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['axes.unicode_minus'] = False
plt.figure(figsize = (10,7))
plt.plot(history_1.history['loss'], color = 'coral', label = 'Training loss')
plt.plot(history_1.hi... | https://stackoverflow.com/questions/75404964/how-to-convert-hyphen-to-minus-for-exponent-in-matplotlib | python, matplotlib, math, data-science | 1,675,980,623 |
se_75398716 | stackoverflow | DATA_SCIENCE | Types of algirthms using to predict item inventory stock | Types of algirthms using to predict item inventory stock
I want to predict stock by analyzing stock mouvement.
Stock mouvement
enter image description here
STOCK :
enter image description here
Which step to start analzying data using machine learning.
Which algorithme ML and DL to use.
Thanks a lot
I need :
learn step... | https://stackoverflow.com/questions/75398716/types-of-algirthms-using-to-predict-item-inventory-stock | dataframe, machine-learning, deep-learning, data-science, prediction | 1,675,946,329 |
se_75381580 | stackoverflow | DATA_SCIENCE | How to find the impact of one variable on the other when there seems to no correlation between them? | How to find the impact of one variable on the other when there seems to no correlation between them?
can we predict growth percentage in sales of an item given the change in discount(positive or negative number) from the previous year as a predictor variable. There seems to be no correlation between these. How to solv... | https://stackoverflow.com/questions/75381580/how-to-find-the-impact-of-one-variable-on-the-other-when-there-seems-to-no-corre | machine-learning, regression, data-science, artificial-intelligence, non-linear-regression | 1,675,833,039 |
se_75380282 | stackoverflow | DATA_SCIENCE | How can we use Feature Importance to Find the 'Worst' Features? | How can we use Feature Importance to Find the 'Worst' Features?
I have some data at work that is confidential so I can't share it here, but the dataset below illustrates the point quite well. Basically, I want to run a feature importance exercise to find the top independent features (in this case, RM, LSTAT, a... | https://stackoverflow.com/questions/75380282/how-can-we-use-feature-importance-to-find-the-worst-features | python, python-3.x, machine-learning, data-science, feature-selection | 1,675,815,527 |
se_75380470 | stackoverflow | DATA_SCIENCE | Making uniform the spellings of observations in two pandas dataframes before merging | Making uniform the spellings of observations in two pandas dataframes before merging
I have df1 with country and sales and df2 with country and sales. Country spelling is not exactly the same in df1 and df2. How do I make country spelling in df1 match that of df2 before merging the two dataframes together.
The merge b... | https://stackoverflow.com/questions/75380470/making-uniform-the-spellings-of-observations-in-two-pandas-dataframes-before-mer | python, pandas, merge, data-science, data-manipulation | 1,675,818,290 |
se_75366986 | stackoverflow | DATA_SCIENCE | Should i include model.train() with Dropout in PytorchLightning | Should i include model.train() with Dropout in PytorchLightning
I was reading guide in which an author used model.train() in each epoch because of the DropOut layer (he didn't use Pytorch Lightning). The question is - should i include model.train() in my Pytorch Lightning Module and if so, how do i do it ? (Or it does... | https://stackoverflow.com/questions/75366986/should-i-include-model-train-with-dropout-in-pytorchlightning | python, deep-learning, pytorch, data-science, pytorch-lightning | 1,675,720,590 |
se_75367998 | stackoverflow | DATA_SCIENCE | LightningDataModule with Trainer in PytorchLightning automatically fits validation model? | LightningDataModule with Trainer in PytorchLightning automatically fits validation model?
I try to fight with overfitting, this is why I decided to look through documentation (https://pytorch-lightning.readthedocs.io/en/stable/common/evaluation_basic.html#train-with-the-validation-loop), where I found that you can pas... | https://stackoverflow.com/questions/75367998/lightningdatamodule-with-trainer-in-pytorchlightning-automatically-fits-validati | python, deep-learning, pytorch, data-science, pytorch-lightning | 1,675,731,322 |
se_75371089 | stackoverflow | DATA_SCIENCE | Input 0 of layer "sequential" is incompatible with the layer: expected shape....... found shape=(None, 143) | Input 0 of layer "sequential" is incompatible with the layer: expected shape....... found shape=(None, 143)
I am a beginner in machine learning and I am trying to train a model with nltk and tensorflow. But I get the following error when I run my program. I understand the problem. it seems that the shape of ... | https://stackoverflow.com/questions/75371089/input-0-of-layer-sequential-is-incompatible-with-the-layer-expected-shape | python-2.7, tensorflow, machine-learning, keras, data-science | 1,675,761,110 |
se_75346551 | stackoverflow | DATA_SCIENCE | How to get index number of pandas data frame that contain only null values | How to get index number of pandas data frame that contain only null values
Consider the below data frame.
Dataframe
I want to extract the ids of this dataframe that contain only null values.
For example, id 1 has only null values. So the answer should be index 1. Can you please explain how to extract this?
Please note... | https://stackoverflow.com/questions/75346551/how-to-get-index-number-of-pandas-data-frame-that-contain-only-null-values | python, pandas, dataframe, data-science, data-preprocessing | 1,675,528,219 |
se_75356514 | stackoverflow | DATA_SCIENCE | How would I create an SQL query to get the following result, Data Science Question? | How would I create an SQL query to get the following result, Data Science Question?
I am working on a project with sample data for vehicle report relays the data is as follows: (timetransmittedtz is a timestamp)
device_uuid
vin
jurisdiction
odometer
timetransmitted_tz
readingtype
00012fg5-0b35-123c-456c-789b1d... | https://stackoverflow.com/questions/75356514/how-would-i-create-an-sql-query-to-get-the-following-result-data-science-questi | sql, database, data-science, amazon-redshift, structured-data | 1,675,644,493 |
se_59275239 | stackoverflow | DATA_SCIENCE | AnnotationHub Resource | Failed to load Resource | Download Issue in R | AnnotationHub Resource | Failed to load Resource | Download Issue in R
When I run Command ah[[1]] I faced the following Problem:
retrieving 1 resource
Error: failed to load resource
name: AH5087
title: ORegAnno
reason: 1 resources failed to download
In addition: Warning messages:
1: download failed
web resour... | https://stackoverflow.com/questions/59275239/annotationhub-resource-failed-to-load-resource-download-issue-in-r | r, annotations, data-science, genome | 1,576,011,457 |
se_75353563 | stackoverflow | DATA_SCIENCE | How to delete a slide that contains a certain text from all the pptx files in multiple directories? | How to delete a slide that contains a certain text from all the pptx files in multiple directories?
I am trying to delete all the slides that contains a specific text ('apple') from all the pptx files in multiple directories. The code below is able to accomplish that.
import os
import glob
import pptx
def delete_slid... | https://stackoverflow.com/questions/75353563/how-to-delete-a-slide-that-contains-a-certain-text-from-all-the-pptx-files-in-mu | python, machine-learning, data-science, powerpoint, python-pptx | 1,675,612,371 |
se_75357670 | stackoverflow | DATA_SCIENCE | How to calculate average level on certain days and times in a pandas data frame | How to calculate average level on certain days and times in a pandas data frame
I have a data frame like so
Date_Time
Level
2017-08-08 23:55:01
239.0
2017-08-08 23:50:01
242.0
2017-08-08 23:45:01
246.0
2017-08-08 23:40:01
250.0
2017-08-08 23:35:01
254.0
...
...
2017-07-26 00:23:57
72.0
2017-07-26... | https://stackoverflow.com/questions/75357670/how-to-calculate-average-level-on-certain-days-and-times-in-a-pandas-data-frame | python, pandas, data-science | 1,675,661,845 |
se_74412374 | stackoverflow | DATA_SCIENCE | Extracting a Rust Polars dataframe value as a scalar value | Extracting a Rust Polars dataframe value as a scalar value
I have the following code to find the mean of the ages in the dataframe.
let df = df! [
"name" => ["panda", "polarbear", "seahorse"],
"age" => [5, 7, 1],
].unwrap();
let mean = df
.lazy()
.select([col("age").mean()])
.collect().unwrap();
... | https://stackoverflow.com/questions/74412374/extracting-a-rust-polars-dataframe-value-as-a-scalar-value | rust, data-science, rust-polars | 1,668,251,526 |
se_75355560 | stackoverflow | DATA_SCIENCE | Visualizing density function - difference between displot() and plot() | Visualizing density function - difference between displot() and plot()
I visualize density function (PDF) using two plotting approaches: displot() and plot(). I don't understand why displot() doesn't produce normally distributed plot wheras plot() do this perfectly. Density plots should look alike but they don't. What... | https://stackoverflow.com/questions/75355560/visualizing-density-function-difference-between-displot-and-plot | python, statistics, seaborn, data-science | 1,675,631,706 |
se_75353008 | stackoverflow | DATA_SCIENCE | Passing sparse distance matrix to AgglomerativeClustering is giving TypeError | Passing sparse distance matrix to AgglomerativeClustering is giving TypeError
I was getting MemoryError when I imported 100,000 documents to pairwise_distances function. For this reason, I sparsely calculated the distance matrix piece by piece and combined it finally. But AgglomerativeClustering does not take sparse m... | https://stackoverflow.com/questions/75353008/passing-sparse-distance-matrix-to-agglomerativeclustering-is-giving-typeerror | python, data-science, cluster-analysis, pairwise-distance | 1,675,607,492 |
se_75352561 | stackoverflow | DATA_SCIENCE | if y is a pandas series object with 0 and 1, then what does y.values==0,1 or y.values==0,0 means? | if y is a pandas series object with 0 and 1, then what does y.values==0,1 or y.values==0,0 means?
y= pd.Series([0,1,0,1,1,0])
In the code below they have used this and i am stuck on this point. what does y.values==0,0 means and how all the other combination are different from one another.
plt.figure(dpi=120)
plt.scat... | https://stackoverflow.com/questions/75352561/if-y-is-a-pandas-series-object-with-0-and-1-then-what-does-y-values-0-1-or-y-v | python, pandas, data-science, series | 1,675,603,269 |
se_75350890 | stackoverflow | DATA_SCIENCE | why i am facing with problem when i try to change columns to 0 an 1? | why i am facing with problem when i try to change columns to 0 an 1?
data.head()
experience
stay
No relevent experience
0
Has relevent experience
1
No relevent experience
0
Has relevent experience
1
No relevent experience
0
data['experience'] = data['experience'].map({'Has relevent experience':Tru... | https://stackoverflow.com/questions/75350890/why-i-am-facing-with-problem-when-i-try-to-change-columns-to-0-an-1 | python, pandas, datatables, data-science, nan | 1,675,584,585 |
se_64393028 | stackoverflow | DATA_SCIENCE | Select different columns in different rows according to another pandas Series | Select different columns in different rows according to another pandas Series
I have a pandas Series which contains the column names that I need to collect data from:
1 col1
3 col4
4 col3
5 col5
6 col5
And the dataframe that contains data looks like:
col1 col2 col3 ... | https://stackoverflow.com/questions/64393028/select-different-columns-in-different-rows-according-to-another-pandas-series | python, pandas, dataframe, logic, data-science | 1,602,865,741 |
se_75340196 | stackoverflow | DATA_SCIENCE | Concatenate video frames using AvgPooling | Concatenate video frames using AvgPooling
I have features extracted from 4 images. These images are video frames. And i want to combine them into one vector of shape (1 ,768) or (1, 512) Is AvgPooling the best way to do it?
import torch
input = torch.rand([1, 4, 768])
sumpool = torch.nn.AdaptiveAvgPool2d((1, 512))
sum... | https://stackoverflow.com/questions/75340196/concatenate-video-frames-using-avgpooling | python, machine-learning, pytorch, computer-vision, data-science | 1,675,452,323 |
se_75340327 | stackoverflow | DATA_SCIENCE | How do I solve an import issue with numpy in scikit.decomposition.PCA? | How do I solve an import issue with numpy in scikit.decomposition.PCA?
I was trying to use the scikit.decomposition.PCA package and I couldn't even import it.
import numpy as np
from sklearn.decomposition import PCA
I've upgraded both of np and scikit, but the error seems to be w/in scikit, what should I do?
*Note: U... | https://stackoverflow.com/questions/75340327/how-do-i-solve-an-import-issue-with-numpy-in-scikit-decomposition-pca | python, numpy, data-science, pca, scikits | 1,675,453,180 |
se_75339015 | stackoverflow | DATA_SCIENCE | How to restructure this dataframe using Python? | How to restructure this dataframe using Python?
[What I am starting out withWhat I want to end up with](https://i.sstatic.net/xW8Zf.jpg)I am having trouble writing the code to transform this dataset into what you see below. I am a beginner and am just practicing using Python.
So far, I have tried the str.split, but it... | https://stackoverflow.com/questions/75339015/how-to-restructure-this-dataframe-using-python | python, pandas, dataframe, data-science | 1,675,444,483 |
se_63438454 | stackoverflow | DATA_SCIENCE | How to Generate a dataset based on mean, median, 1st & 9th decile values? | How to Generate a dataset based on mean, median, 1st & 9th decile values?
I have the following values that describe a dataset:
Number of Samples: 5388
Mean: 4173
Median: 4072
1st Decile: 2720
9th Decile: 5676
I need to generate any datasets that will fit these values.
All the examples I found require you to have ... | https://stackoverflow.com/questions/63438454/how-to-generate-a-dataset-based-on-mean-median-1st-9th-decile-values | python, pandas, numpy, statistics, data-science | 1,597,590,544 |
se_75331857 | stackoverflow | DATA_SCIENCE | Unzipping tokenizers\punkt.zip in nltk.download('punkt') | Unzipping tokenizers\punkt.zip in nltk.download('punkt')
I have integrate ntlk in my python project but after installing punkt by nltk.download('punkt')
is is showing
Unzipping tokenizers\punkt.zip.
I have check the nltk-data download location for confirmation but nothing happened. | https://stackoverflow.com/questions/75331857/unzipping-tokenizers-punkt-zip-in-nltk-downloadpunkt | python, machine-learning, deep-learning, neural-network, data-science | 1,675,402,221 |
se_75239530 | stackoverflow | DATA_SCIENCE | ı writing data process pipeline with luigi but ı get error | ı writing data process pipeline with luigi but ı get error
import os
import luigi
import pandas as pd
import requests as req
from bs4 import BeautifulSoup
class DownloadData(luigi.Task):
def run(self):
site = req.get("http://www.gutenberg.org/browse/scores/top").text
with self.output().open("w") ... | https://stackoverflow.com/questions/75239530/%c4%b1-writing-data-process-pipeline-with-luigi-but-%c4%b1-get-error | python, data-science, pipeline, data-extraction, luigi | 1,674,678,665 |
se_75317571 | stackoverflow | DATA_SCIENCE | is there a way to solve utf-8' codec | is there a way to solve utf-8' codec
I am trying to read csv file in pandas
df1 = pd.read_csv("C:/Users/Dell/Desktop/GUVI PROJECTS/placement tasks/DDW_B18_0800_NIC_FINAL_STATE_RAJASTHAN-2011.csv")
but i am getting error as
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 23483: invalid start b... | https://stackoverflow.com/questions/75317571/is-there-a-way-to-solve-utf-8-codec | python, python-3.x, pandas, dataframe, data-science | 1,675,297,747 |
se_75326570 | stackoverflow | DATA_SCIENCE | How to simultaneously mine sequential patterns and infer variables from a set of sequences? | How to simultaneously mine sequential patterns and infer variables from a set of sequences?
Given a set of sequences, I'm trying to extract a single sequence that captures features common to all sequences in the set.
I'm expressing my sequences as ordered lists of events, each event represented by a multiset or bag of... | https://stackoverflow.com/questions/75326570/how-to-simultaneously-mine-sequential-patterns-and-infer-variables-from-a-set-of | python, machine-learning, data-science, sequence, sequential | 1,675,357,396 |
se_75326143 | stackoverflow | DATA_SCIENCE | How to mark column with 0 or 1 if data exists in another table in Power BI? | How to mark column with 0 or 1 if data exists in another table in Power BI?
I have 2 tables
1 is a set of employees (Table 1)
1 is a set of terminations (Table 2)
They will both match on an Employee ID column. I want to add a new calculated column to Table 1 that returns 1 if the employee is in Table 2 and returns 0 o... | https://stackoverflow.com/questions/75326143/how-to-mark-column-with-0-or-1-if-data-exists-in-another-table-in-power-bi | powerbi, data-science, dax | 1,675,355,286 |
se_75319277 | stackoverflow | DATA_SCIENCE | How to convert monthly data to yearly data with the value as the mean average over the 12 months? (Python Pandas) | How to convert monthly data to yearly data with the value as the mean average over the 12 months? (Python Pandas)
This is what my data looks like:
month total_mobile_subscription
0 1997-01 414000
1 1997-02 423000
2 1997-03 431000
3 1997-04... | https://stackoverflow.com/questions/75319277/how-to-convert-monthly-data-to-yearly-data-with-the-value-as-the-mean-average-ov | python, pandas, dataframe, data-science | 1,675,318,205 |
se_75311057 | stackoverflow | DATA_SCIENCE | 1D histogram from 4 column txt dataset in python? | 1D histogram from 4 column txt dataset in python?
I have a text file with 4 columns, the first 3 are the x, y and z coordinates of one datapoint, and the 4th column is the value of the datapoint at that x, y, z set of coordinates.
For example:
0 1 2 10000
0 1 3 20000
0 2 1 30000
1 0 0 40000
1 1 1 50000
I want to make... | https://stackoverflow.com/questions/75311057/1d-histogram-from-4-column-txt-dataset-in-python | python, arrays, numpy, data-science, histogram | 1,675,258,875 |
se_75297775 | stackoverflow | DATA_SCIENCE | How to properly figure out all possible "long entries" made based on the OHLC data and upper bound and lower bound price series? Pandas related | How to properly figure out all possible "long entries" made based on the OHLC data and upper bound and lower bound price series? Pandas related
Say you have a Pandas df that contains the OHLC (short for the Open, High, Low, Close) prices of a particular financial asset.
Also, you have two other Pandas datafr... | https://stackoverflow.com/questions/75297775/how-to-properly-figure-out-all-possible-long-entries-made-based-on-the-ohlc-da | python, pandas, dataframe, data-science, back-testing | 1,675,171,070 |
se_75284274 | stackoverflow | DATA_SCIENCE | Draw lines in a 3-d scatter plot | Draw lines in a 3-d scatter plot
I have a 3d scatter plot. And I want to draw two lines that will describe dots for 2021 and 2022. Is there any way to do it in matplotlib? I will attach I want it to look like. The black line are the ones I need.
I tried to ask chat gpt, but it didn't understand what I want to do. | https://stackoverflow.com/questions/75284274/draw-lines-in-a-3-d-scatter-plot | python, matplotlib, charts, data-science, linear-regression | 1,675,081,072 |
se_75294121 | stackoverflow | DATA_SCIENCE | Huggingface: ValueError: You have to specify either decoder_input_ids or decoder_inputs_embeds | Huggingface: ValueError: You have to specify either decoder_input_ids or decoder_inputs_embeds
I am fine-tuning 'microsoft/trocr-base-printed' image2text model to let it recognize the captcha text on it. I was able to find this link to try to avoid the error: ValueError: You have to specify either decoder_input_ids or... | https://stackoverflow.com/questions/75294121/huggingface-valueerror-you-have-to-specify-either-decoder-input-ids-or-decoder | python, data-science, huggingface | 1,675,151,709 |
se_75289872 | stackoverflow | DATA_SCIENCE | how to transcope a part of column as rows in pandas | how to transcope a part of column as rows in pandas
i have a data of some patients and they are in a configuration that cant be used for data analysis
we have a couple of patients that each patients have multiple visits to our clinic. therefor, in our data we have a row for a visit an it contains some data and as i me... | https://stackoverflow.com/questions/75289872/how-to-transcope-a-part-of-column-as-rows-in-pandas | pandas, data-science, data-analysis | 1,675,111,068 |
se_75288232 | stackoverflow | DATA_SCIENCE | How to detect horizontal line (stagnation) in data? | How to detect horizontal line (stagnation) in data?
How can I detect horizontal lines in my data in python?
I have used function scipy.signal.find_peaks() to find local minima and maxima. I can use that to separate ascending and descending parts. But I need to isolate the peaks from the flat line (marked with red circ... | https://stackoverflow.com/questions/75288232/how-to-detect-horizontal-line-stagnation-in-data | python, math, scipy, data-science | 1,675,100,892 |
se_75280718 | stackoverflow | DATA_SCIENCE | '4/20/22, 4:08 PM - ', how to format this date using python | '4/20/22, 4:08 PM - ', how to format this date using python
I am not getting values its showing NAT at every date position
The code I used:
df['message_date'] = pd.to_datetime(df['message_date'], format='%m/%d/%y, %I:%M %p -',errors="coerce") | https://stackoverflow.com/questions/75280718/4-20-22-408-pm-how-to-format-this-date-using-python | python, pandas, machine-learning, data-science | 1,675,058,393 |
se_64908317 | stackoverflow | DATA_SCIENCE | How could I solve this error to scrape Twitter with Python? | How could I solve this error to scrape Twitter with Python?
I'm trying to do a personal project for my portfolio, I would like to scrape the tweets about the president Macron but I get this error with twitterscrapper.
from twitterscraper import query_tweets
import datetime as dt
import pandas as pd
begin_date=dt.date... | https://stackoverflow.com/questions/64908317/how-could-i-solve-this-error-to-scrape-twitter-with-python | python, pandas, web-scraping, twitter, data-science | 1,605,776,110 |
se_75286048 | stackoverflow | DATA_SCIENCE | How to predict sales data as total and sub category wise? | How to predict sales data as total and sub category wise?
I have a data set of a tea export company and it includes total export and tea types and weight categories.
It looked like this
Date Type Weight Quantity Price
2016-01-01 black bags 1734136.51 1131.30
2016-01-01 black bulk 1... | https://stackoverflow.com/questions/75286048/how-to-predict-sales-data-as-total-and-sub-category-wise | python, pandas, data-science, prediction | 1,675,090,145 |
se_68137180 | stackoverflow | DATA_SCIENCE | NVIDIA data-science-stack ==> For changes to take effect, close and re-open your current shell. <== | NVIDIA data-science-stack ==> For changes to take effect, close and re-open your current shell. <==
I cloned the repository for nvidias data-science-stack, went into the directory, and followed the instructions in README.md.
after I build the container by executing ./data-science-stack build-container
I get a pr... | https://stackoverflow.com/questions/68137180/nvidia-data-science-stack-for-changes-to-take-effect-close-and-re-open-your | data-science, nvidia | 1,624,656,129 |
se_75279802 | stackoverflow | DATA_SCIENCE | How to find smallest cluster of location which are within a given distance | How to find smallest cluster of location which are within a given distance
I have a set of co-ordinates in latitude and longitude format. I need to find the smallest cluster from these coordinates which are within say 50 mile distance to each other.
I am new to data science, how can I implement this in Python without ... | https://stackoverflow.com/questions/75279802/how-to-find-smallest-cluster-of-location-which-are-within-a-given-distance | python, geolocation, data-science | 1,675,045,828 |
se_75278825 | stackoverflow | DATA_SCIENCE | Masking the Zip Codes | Masking the Zip Codes
I'm taking a course and I need to solve the following assignment:
"In this part, you should write a for loop, updating the df_users dataframe.
Go through each user, and update their zip code, to Safe Harbor specifications:
If the user is from a zip code for the which the “Geographic Subdivision” ... | https://stackoverflow.com/questions/75278825/masking-the-zip-codes | python, pandas, dataframe, data-science | 1,675,031,127 |
se_54615768 | stackoverflow | DATA_SCIENCE | Errors when using getSymbols() quantmod to predict stock price | Errors when using getSymbols() quantmod to predict stock price
I was trying to use quantmod to download some history data of stock price, here's my code:
Nasdaq100_Symbols <- c('GE','PG','MSFT','AAPL','PFE','AMD','DELL','GRPN','FB','CSCO','INTC',
'EZJ.L','BP','HSBC','MKS')
getSymbols(Nasdaq100_Sym... | https://stackoverflow.com/questions/54615768/errors-when-using-getsymbols-quantmod-to-predict-stock-price | r, time-series, data-science, data-analysis, business-intelligence | 1,549,796,990 |
se_75254140 | stackoverflow | DATA_SCIENCE | Can I use the output of tf.keras.utils.image_dataset_from_directory to train an autoencoder? | Can I use the output of tf.keras.utils.image_dataset_from_directory to train an autoencoder?
To put it simply, I'd like to be able to use a keras dataset created from a local image directory to train an autoencoder. To clarify, this is a model that approximates the Identity function for images : ideally, the output is... | https://stackoverflow.com/questions/75254140/can-i-use-the-output-of-tf-keras-utils-image-dataset-from-directory-to-train-an | tensorflow, keras, dataset, data-science, autoencoder | 1,674,794,405 |
se_75260659 | stackoverflow | DATA_SCIENCE | .append creates nan values for new added row and saves the values on new indexes. Why? | .append creates nan values for new added row and saves the values on new indexes. Why?
I have this data set:
inner_watt = pd.DataFrame(pd.read_csv('input/0.7mm/0.7inner-100watt.csv')[' Current-A'])
Current-A
2.3309
2.3309
2.3309
2.3309
2.3309
2.3309
2.3309
2.3309
Now i slice the first 4 entries/samples and take a tr... | https://stackoverflow.com/questions/75260659/append-creates-nan-values-for-new-added-row-and-saves-the-values-on-new-indexes | python, machine-learning, data-science | 1,674,836,099 |
se_75061277 | stackoverflow | DATA_SCIENCE | Split subfolders of patients into train test folders | Split subfolders of patients into train test folders
I have a population of patient MRIs and masked truths of a muscle. I am working on a U-Net segmentation algorithm to automatically segment and determine the size of a muscle. I originally ran all slices of every patient through train test split, however, I realized ... | https://stackoverflow.com/questions/75061277/split-subfolders-of-patients-into-train-test-folders | python, machine-learning, deep-learning, data-science, train-test-split | 1,673,287,444 |
se_75252659 | stackoverflow | DATA_SCIENCE | Make Certain Points in Plotly Express Scatterplot different Colors | Make Certain Points in Plotly Express Scatterplot different Colors
Currently, I have a scatterplot with each point representing a director, based on the production budget and profit they have. I want to highlight some of these points that standout with their own unique color, and create a legend saying who each one of... | https://stackoverflow.com/questions/75252659/make-certain-points-in-plotly-express-scatterplot-different-colors | python, plotly, data-science, scatter-plot | 1,674,775,393 |
se_75253315 | stackoverflow | DATA_SCIENCE | How to count text event type and transform it into country-year data using pandas? | How to count text event type and transform it into country-year data using pandas?
I am trying to convert a dataframe where each row is a specific event, and each column has information about the event. I want to turn this into data in which each row is a country and year with information about the number and characte... | https://stackoverflow.com/questions/75253315/how-to-count-text-event-type-and-transform-it-into-country-year-data-using-panda | python, pandas, group-by, data-science, jupyter | 1,674,783,137 |
se_75252198 | stackoverflow | DATA_SCIENCE | How to convert "event" data into country-year data by summating information in columns? Using python/pandas | How to convert "event" data into country-year data by summating information in columns? Using python/pandas
I am trying to convert a dataframe where each row is a specific event, and each column has information about the event. I want to turn this into data in which each row is a country and year with inform... | https://stackoverflow.com/questions/75252198/how-to-convert-event-data-into-country-year-data-by-summating-information-in-c | python, pandas, dataframe, data-science | 1,674,771,336 |
se_75250803 | stackoverflow | DATA_SCIENCE | Python how to create a dictionary using the values in multiple pandas dataframe columns as tuple keys and a single column as value | Python how to create a dictionary using the values in multiple pandas dataframe columns as tuple keys and a single column as value
I would like to create a dictionary using the values in the pandas' data frame multiple columns as tuple keys and single-column values as the value(s). And where there are no values for a ... | https://stackoverflow.com/questions/75250803/python-how-to-create-a-dictionary-using-the-values-in-multiple-pandas-dataframe | python, dataframe, data-science | 1,674,761,340 |
se_69433910 | stackoverflow | DATA_SCIENCE | Missing 'Find in Selection' in VS Code when editing Jupyter Notebooks | Missing 'Find in Selection' in VS Code when editing Jupyter Notebooks
The 'find in selection' button is missing from VSCode when working with Jupyter Notebooks. It slows down development so I would like to ask if anybody knows how to activate it?
First image shows the search/replace when in a python file. Seco... | https://stackoverflow.com/questions/69433910/missing-find-in-selection-in-vs-code-when-editing-jupyter-notebooks | python, visual-studio-code, jupyter-notebook, data-science | 1,633,340,723 |
se_60712525 | stackoverflow | DATA_SCIENCE | <lifelines> Solving Cox Proportional Hazard after creating interaction variable with time | <lifelines> Solving Cox Proportional Hazard after creating interaction variable with time
I am using lifelines package to do Cox Regression. After trying to fit the model, I checked the CPH assumptions for any possible violations and it returned some problematic variables, along with the suggested solutions.
On... | https://stackoverflow.com/questions/60712525/lifelines-solving-cox-proportional-hazard-after-creating-interaction-variable | python, data-science, survival-analysis, cox-regression, lifelines | 1,584,389,013 |
se_75237748 | stackoverflow | DATA_SCIENCE | In a scatterplot, how do I plot a line that is an average of the all vertical coordinates of datapoints that has the same x coordinate | In a scatterplot, how do I plot a line that is an average of the all vertical coordinates of datapoints that has the same x coordinate
I want something like the plots shown in figure below, where the blue line is the average line that is generated by plotting the mean of all y-coordinate values of data-points that ha... | https://stackoverflow.com/questions/75237748/in-a-scatterplot-how-do-i-plot-a-line-that-is-an-average-of-the-all-vertical-co | python, matplotlib, seaborn, data-science | 1,674,668,066 |
se_75238624 | stackoverflow | DATA_SCIENCE | non-numeric argument to binary operator is the error i am getting | non-numeric argument to binary operator is the error i am getting
list =ls()
set.seed(1234)
S<- numeric()
Y_bar <- numeric()
Xsq <- numeric()
T_st <- numeric()
for (i in c(1:10000)) {
sample = rnorm(n= 20, mean=2, sd = 5)
s = var(sample)
S <-append(S,s)
y_bar = mean(sample)
Y_bar<-append(Y_bar,y_bar)
... | https://stackoverflow.com/questions/75238624/non-numeric-argument-to-binary-operator-is-the-error-i-am-getting | r, data-science, static-analysis | 1,674,672,973 |
se_75238514 | stackoverflow | DATA_SCIENCE | how to plot top k rows by a given column as a bar plot in FacetGrid (with code dummy data and solution in matplotlib) | how to plot top k rows by a given column as a bar plot in FacetGrid (with code dummy data and solution in matplotlib)
the task is to plot the top 5 NBA players according to accumulated points, as a bar plot, and to compare between east and west players
i implemented the solution in matplotlib but i want to know how to... | https://stackoverflow.com/questions/75238514/how-to-plot-top-k-rows-by-a-given-column-as-a-bar-plot-in-facetgrid-with-code-d | python, pandas, seaborn, data-science, facet-grid | 1,674,672,366 |
se_58420389 | stackoverflow | DATA_SCIENCE | Using Altair on data aggregated from large datasets | Using Altair on data aggregated from large datasets
I am trying to histogram counts of a large (300,000 records) temporal data set. I am for now just trying to histogram by month which is only 6 data points, but doing this with either json or altair_data_server storage makes the page crash. Is this impossible to handl... | https://stackoverflow.com/questions/58420389/using-altair-on-data-aggregated-from-large-datasets | python, data-visualization, data-science, altair, vega-lite | 1,571,253,802 |
se_75234046 | stackoverflow | DATA_SCIENCE | MySQL fill NULL row with value based on the nearest value in another row | MySQL fill NULL row with value based on the nearest value in another row
I'm trying to update rows in a scores table based on the following logic:
Get the feat_sum for ids that don't have a score.
For each feat_sum that has a NULL score, get the row with the nearest feat_sum and score and then update the score fie... | https://stackoverflow.com/questions/75234046/mysql-fill-null-row-with-value-based-on-the-nearest-value-in-another-row | mysql, sql, data-science | 1,674,649,956 |
se_75235732 | stackoverflow | DATA_SCIENCE | Data collection frequency strategy | Data collection frequency strategy
I have a question and I am wondering if anyone has solved this problem effectively. I am developing a collector(let's call it A) to collect data from a source(let's call it B) which in turn collects data from somewhere else. B collects every 5 minutes, what frequency or strategy shou... | https://stackoverflow.com/questions/75235732/data-collection-frequency-strategy | web-scraping, google-bigquery, data-science, bigdata | 1,674,658,386 |
se_75232176 | stackoverflow | DATA_SCIENCE | How to use pythons in operator in a dataframe to search for a string and return boolean in a new column in the same dataframe | How to use pythons in operator in a dataframe to search for a string and return boolean in a new column in the same dataframe
I have a dataframe df which contains movies data.
.
I want to create a new column in df called "drama_movie" which contains the value True for the movies that are Dramas and False for if they a... | https://stackoverflow.com/questions/75232176/how-to-use-pythons-in-operator-in-a-dataframe-to-search-for-a-string-and-return | python, pandas, dataframe, data-science | 1,674,640,251 |
se_75232220 | stackoverflow | DATA_SCIENCE | Is there any way to reduce the size of tflite-model-maker? | Is there any way to reduce the size of tflite-model-maker?
I'm trying to run a notebook on deepnote/colab but I keep getting the same issue, everytime tflite-model-maker tries to install it just fills the disk entirely and can't install.
Deepnote is limited at 5GB of disk storage and colab is around 100GB but I keep g... | https://stackoverflow.com/questions/75232220/is-there-any-way-to-reduce-the-size-of-tflite-model-maker | tensorflow, data-science, google-colaboratory, tensorflow-lite | 1,674,640,469 |
se_75191251 | stackoverflow | DATA_SCIENCE | keras and tesnorflow do not work after installing in pycharm | keras and tesnorflow do not work after installing in pycharm
This is my code:-
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.pylab import rcParams
rcParams['figure.figsize']=20,10
from keras import Sequential
from keras import LSTM,Dropout,Dense
from ... | https://stackoverflow.com/questions/75191251/keras-and-tesnorflow-do-not-work-after-installing-in-pycharm | python, data-science | 1,674,277,753 |
se_75224714 | stackoverflow | DATA_SCIENCE | how to input the data of several meteorological stations into a machine learning model? | how to input the data of several meteorological stations into a machine learning model?
I have a dataset with 15 different meteorological stations (providing T, rh, wind direction through time).
How should I implement them in a machine learning model? As independent inputs or can I combine them?
If you could provide m... | https://stackoverflow.com/questions/75224714/how-to-input-the-data-of-several-meteorological-stations-into-a-machine-learning | python, database, machine-learning, deep-learning, data-science | 1,674,579,243 |
se_75224176 | stackoverflow | DATA_SCIENCE | Classifiers and Numpy Array | Classifiers and Numpy Array
from __future__ import print_function
from builtins import range
from builtins import object
import numpy as np
import matplotlib.pyplot as plt
from past.builtins import xrange
class TwoLayerNet(object):
"""
A two-layer fully-connected neural network. The net has an input dimensio... | https://stackoverflow.com/questions/75224176/classifiers-and-numpy-array | python, machine-learning, neural-network, data-science | 1,674,576,472 |
se_75217554 | stackoverflow | DATA_SCIENCE | Error while splitting the DataFrame into Train Set & Test Set | Error while splitting the DataFrame into Train Set & Test Set
I am self-learning ML & DS. I am getting stuck while trying to split the DaaFrame (dfc).
The following error and the various posts on this site suggest that this error is due to the non-conversion of the DataFrame into an integer. However as much as I k... | https://stackoverflow.com/questions/75217554/error-while-splitting-the-dataframe-into-train-set-test-set | python, machine-learning, data-science | 1,674,536,243 |
se_75213266 | stackoverflow | DATA_SCIENCE | A different merge | A different merge
So I have two tables and thoses are the samples:
df1:
Element
Range
Family
Ae_aag2/0013F
5-2500
Chuviridae
Ae_aag2/0014F
300-2100
Flaviviridae
df2:
Element
Range
Family
0012F
30-720
Chuviridae
0013F
23-1200
Chuviridae
0013F
1300-2610
Xinmoviridae
And I need to join the ta... | https://stackoverflow.com/questions/75213266/a-different-merge | pandas, group-by, merge, data-science | 1,674,496,496 |
se_75208954 | stackoverflow | DATA_SCIENCE | xgboost Gini Feature Importance - standardized data vs raw data | xgboost Gini Feature Importance - standardized data vs raw data
I have an XGBoost model and the Gini feature importance that I get if I pass in standardized data vs non-standardized data is completely different. I thought xgboost is immune to standardization. Can you please help me understand?
from xgboost import XGBC... | https://stackoverflow.com/questions/75208954/xgboost-gini-feature-importance-standardized-data-vs-raw-data | python, data-science, xgboost | 1,674,473,793 |
se_75207795 | stackoverflow | DATA_SCIENCE | Pandas: Reading Excel with merged row cells | Pandas: Reading Excel with merged row cells
I tried to clean the data as tabular by using pandas and the data is an excel file. The problem is merged row cell which is a type of data. I want to transpose it as a new column to classify the data.
What I'm Facing
enter image description here
What I'm expected.
enter imag... | https://stackoverflow.com/questions/75207795/pandas-reading-excel-with-merged-row-cells | python, excel, pandas, dataframe, data-science | 1,674,467,338 |
se_75207646 | stackoverflow | DATA_SCIENCE | How to perform conditional aggregation AFTER groupby in python? | How to perform conditional aggregation AFTER groupby in python?
My 1st column is 'year'. My 2nd column is 'bank'. My last column is a "value".
I want to get the SUM of VALUE for year=2003 for each 'bank' and display that in a new column.
ie if my starting dataframe can be represented by the following code:
df = pd.Dat... | https://stackoverflow.com/questions/75207646/how-to-perform-conditional-aggregation-after-groupby-in-python | python, python-3.x, pandas, jupyter-notebook, data-science | 1,674,466,429 |
se_75193544 | stackoverflow | DATA_SCIENCE | Improve Neo4j Cypher Query find synonyms on image board with gds.alpha.linkprediction.commonNeighbors | Improve Neo4j Cypher Query find synonyms on image board with gds.alpha.linkprediction.commonNeighbors
Hi i have the following query:
I have crawled and saved an imageboard into a neo4j database.
On this website users can ad "tags" to images, which can be used to search for them.
Because i want to help to improve the s... | https://stackoverflow.com/questions/75193544/improve-neo4j-cypher-query-find-synonyms-on-image-board-with-gds-alpha-linkpredi | database, algorithm, neo4j, cypher, data-science | 1,674,306,219 |
se_75206264 | stackoverflow | DATA_SCIENCE | I accidentally deleted a ipynb notebook in Vertex AI workbench. How can I recover it back? | I accidentally deleted a ipynb notebook in Vertex AI workbench. How can I recover it back?
I just got the history of all the commands I ran before on Vertex AI. But not able to recover the specific file. | https://stackoverflow.com/questions/75206264/i-accidentally-deleted-a-ipynb-notebook-in-vertex-ai-workbench-how-can-i-recove | python, google-cloud-platform, data-science, recovery, google-cloud-vertex-ai | 1,674,455,549 |
se_75204511 | stackoverflow | DATA_SCIENCE | Is there anyway to apply different prediction models to a dataframe depending on the value of a column? | Is there anyway to apply different prediction models to a dataframe depending on the value of a column?
Let's say that I have a dataframe and I want to create a model that estimates the blood pressure of patients. After doing an exploratory analisis with with a training set, I've decided that what's better is to creat... | https://stackoverflow.com/questions/75204511/is-there-anyway-to-apply-different-prediction-models-to-a-dataframe-depending-on | python, pandas, numpy, data-science, prediction | 1,674,428,350 |
se_75197513 | stackoverflow | DATA_SCIENCE | Polynomial Features Error: X has 10 features, but PolynomialFeatures is expecting 9 features as input | Polynomial Features Error: X has 10 features, but PolynomialFeatures is expecting 9 features as input
Today i'm modeling a dataframe using PolinomialFeatures from sklearn but I keep encountering this error: ValueError: X has 10 features, but PolynomialFeatures is expecting 9 features as input.
Coming from the line whe... | https://stackoverflow.com/questions/75197513/polynomial-features-error-x-has-10-features-but-polynomialfeatures-is-expectin | python, pandas, scikit-learn, data-science, sklearn-pandas | 1,674,346,720 |
se_75196680 | stackoverflow | DATA_SCIENCE | If a string or multiple strings from a list matches the value(strings) from a specific column then, how to populate a new column with matched strings? | If a string or multiple strings from a list matches the value(strings) from a specific column then, how to populate a new column with matched strings?
I have a pandas data frame and a list. I am trying to match the list of string with the data frame and fill a new column named system_name with the matched string or st... | https://stackoverflow.com/questions/75196680/if-a-string-or-multiple-strings-from-a-list-matches-the-valuestrings-from-a-sp | python, pandas, dataframe, data-science, data-analysis | 1,674,336,457 |
se_75195264 | stackoverflow | DATA_SCIENCE | How do I reproduce rows in a dataframe while increasing one by one values in an specific column | How do I reproduce rows in a dataframe while increasing one by one values in an specific column
Imagine I have an specific dataframe with four columns (being of them a date) and let's say 12 rows. I would like to add for each row, around 30 replicated rows below but increasing day by day while maintaining the rest sta... | https://stackoverflow.com/questions/75195264/how-do-i-reproduce-rows-in-a-dataframe-while-increasing-one-by-one-values-in-an | python, pandas, dataframe, datetime, data-science | 1,674,322,176 |
se_75191003 | stackoverflow | DATA_SCIENCE | How do I duplicate rows in a dataframe while increasing one by one an specific column | How do I duplicate rows in a dataframe while increasing one by one an specific column
Imagine I have an specific dataframe with four columns (being of them a date) and let's say 12 rows. I would like to add for each row, around 30 replicated rows below but increasing day by day while maintaining the rest static. For e... | https://stackoverflow.com/questions/75191003/how-do-i-duplicate-rows-in-a-dataframe-while-increasing-one-by-one-an-specific-c | python, pandas, dataframe, datetime, data-science | 1,674,272,197 |
se_75187923 | stackoverflow | DATA_SCIENCE | Python Binary Column if GetDate is between dates | Python Binary Column if GetDate is between dates
I am trying to create a binary column in python based if a given data in the GameDate column is between a set of dates.
Here is what I tried:
df5['pre_season'] = df5.gameDate.apply(lambda x: 1 if pd.to_datetime('2021-02-28') <= x <= pd.to_datetime('2021-03-30'):
... | https://stackoverflow.com/questions/75187923/python-binary-column-if-getdate-is-between-dates | python, dataframe, date, binary, data-science | 1,674,238,477 |
se_75187904 | stackoverflow | DATA_SCIENCE | Problem Mapping with Folium Map Geolocalization It appears Empty (white screen) | Problem Mapping with Folium Map Geolocalization It appears Empty (white screen)
I have some trouble with folium map it keeps giving me the result with a full white screen, but the last week it was working.
Here it's a brief of the data:
# Externo Latitud Longitud Cliente Conductor Precio Zona de tarifa2
0 ... | https://stackoverflow.com/questions/75187904/problem-mapping-with-folium-map-geolocalization-it-appears-empty-white-screen | python, maps, data-science, analytics, folium | 1,674,238,307 |
se_75184128 | stackoverflow | DATA_SCIENCE | Spark checkpointing data cleaning frequency | Spark checkpointing data cleaning frequency
I am running the RecoverableNetworkWordCount program as an example to understand the checkpointing and I see checkpoint data created every second. Is it because my StreamingContext batch size is 1 sec? Also checkpoint directory maintains only the last 10 checkpoint data. Is ... | https://stackoverflow.com/questions/75184128/spark-checkpointing-data-cleaning-frequency | scala, apache-spark, data-science, apache-spark-2.0 | 1,674,218,241 |
se_67130608 | stackoverflow | DATA_SCIENCE | Edited: K means clustering and finding points closest to the centroid | Edited: K means clustering and finding points closest to the centroid
I am trying to apply k means to cluster actors based on the information in the following columns
Actors Movies TvGuest Awards Shorts Special LiveShows
Robert De Niro 111 2 6 0 0 0
Jack Nicholson ... | https://stackoverflow.com/questions/67130608/edited-k-means-clustering-and-finding-points-closest-to-the-centroid | python-3.x, pandas, machine-learning, data-science, k-means | 1,618,598,635 |
se_75182045 | stackoverflow | DATA_SCIENCE | Access the `b` parametr in the SVC object of scikit learn | Access the `b` parametr in the SVC object of scikit learn
According to scikit learn's mathematical model of the SVC there is a parameter b (constant value of the model):
Yet in the SVC class documentation I don't see how can one access its value.
Is there a way to access it? Is it really used?
I wonder if I need to m... | https://stackoverflow.com/questions/75182045/access-the-b-parametr-in-the-svc-object-of-scikit-learn | python, scikit-learn, data-science, documentation | 1,674,206,727 |
se_75178603 | stackoverflow | DATA_SCIENCE | How to loop over all columns and check data distribution using Fitter library? | How to loop over all columns and check data distribution using Fitter library?
I need to check data distributions of all my numeric columns in a dataset. I chose Fitter library to do so. I loop over all columns but have only one plot+summary table as an outcome instead. What is wrong with my code?
from fitter import F... | https://stackoverflow.com/questions/75178603/how-to-loop-over-all-columns-and-check-data-distribution-using-fitter-library | python, statistics, data-science | 1,674,164,708 |
se_75175073 | stackoverflow | DATA_SCIENCE | Difficulty understanding indices sequence | Difficulty understanding indices sequence
We trying to filter data from a certain input file but I had trouble understanding certain lines in what they were referring to exactly with the indices. (the ones I didn't understand had the #line comment next to it)
Input file :
Peter, Haddad, M, Dekweneh, 5100
Petra, Yahya... | https://stackoverflow.com/questions/75175073/difficulty-understanding-indices-sequence | python, dataframe, data-science, jupyter | 1,674,144,289 |
se_75173582 | stackoverflow | DATA_SCIENCE | Feed the output of a polars groupby aggregation back in to an operation on the original dataframe? | Feed the output of a polars groupby aggregation back in to an operation on the original dataframe?
I have some timeseries data in a polars LazyFrame where I am detecting events based on extended periods in which some criteria is true.
The signal I am basing this on isn't reliable, so if there is a very small amount of... | https://stackoverflow.com/questions/75173582/feed-the-output-of-a-polars-groupby-aggregation-back-in-to-an-operation-on-the-o | python, dataframe, data-science, python-polars | 1,674,137,531 |
se_75164067 | stackoverflow | DATA_SCIENCE | SQLite: How to select 10 values for each item | SQLite: How to select 10 values for each item
I'm trying to select only 10 values in ASC order for each symbol in my list. Currently I have a query that will select all values :
#syms list will change every time new data is ingested and processed... So I have it static here for reference...
syms = "'O:SPY230118P003... | https://stackoverflow.com/questions/75164067/sqlite-how-to-select-10-values-for-each-item | python, sqlite, data-science, data-analysis | 1,674,068,465 |
se_75163531 | stackoverflow | DATA_SCIENCE | Cannot set header and specific column (type date) formatting - XlsxWriter | Cannot set header and specific column (type date) formatting - XlsxWriter
I've been trying to edit a dataframe into a formated Excel spreadsheet for work, and though most issues were solved elsewhere (Formatting an Excel file with XlsxWriter - Locale settings appear not to be applied to the output file) some remained.... | https://stackoverflow.com/questions/75163531/cannot-set-header-and-specific-column-type-date-formatting-xlsxwriter | python, excel, pandas, data-science, xlsxwriter | 1,674,065,482 |
se_75162272 | stackoverflow | DATA_SCIENCE | How can I merge my columns into a single one using a multiindex | How can I merge my columns into a single one using a multiindex
I have a DataFrame looking like this:
year 2015 2016 2017 2018 2019 2015 2016 2017 2018 2019 ... 2015 2016 2017 2018 2019 2015 2016 2017 2018 2019
PATIENTS PATIENTS PATIENTS PATI... | https://stackoverflow.com/questions/75162272/how-can-i-merge-my-columns-into-a-single-one-using-a-multiindex | python, pandas, data-science | 1,674,059,072 |
se_74947287 | stackoverflow | DATA_SCIENCE | how to merge next nearest data points using a common datetime stamp value for a group? | how to merge next nearest data points using a common datetime stamp value for a group?
I have two data frames like the samples given below:
df1 = pd.DataFrame({"items":["i1", "i1", "i1", "i2","i2", "i2"], "dates":["09-Nov-2022", "10-Aug-2022", "27-May-2022", "20-Oct-2022", "01-Nov-2022","27-Jul-2022"]})
df2 = pd.DataF... | https://stackoverflow.com/questions/74947287/how-to-merge-next-nearest-data-points-using-a-common-datetime-stamp-value-for-a | python, pandas, dataframe, group-by, data-science | 1,672,288,580 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.