Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 69822

pandas is a python library for Panel Data manipulation and analysis, e.g. multidimensional time series and cross-sectional data sets commonly found in statistics, experimental science results, econometrics, or finance.

12 votes
Accepted

How to use SimpleImputer Class to replace missing values with mean values using Python?

Your error is due to using Simple Imputer's fit and fit_transform on a numpy array. Here's how i used it on a Dataframe imr = Imputer(missing_values='NaN', strategy='median', axis=0) imr = imr.fit(da …
Blenz's user avatar
  • 2,094
7 votes
Accepted

Why is pandas corr() deleting columns?

Pearson's correlation is the default correlation used with Pandas corr method. Categorical features ( not numerical ) are ignored during this process due to their nature of not being continuous. …
Blenz's user avatar
  • 2,094
6 votes
Accepted

Obtaining consistent one-hot encoding of train / production data

Use sklearn.preprocessing.OneHotEncoder and transfer the one-hot encoding to your web-service ( i'm guessing that's how you're using the model for inference ) via sklearn.pipeline.Pipeline. The pipeli …
Blenz's user avatar
  • 2,094
2 votes

Problem with sort by and group by in pandas

All you need is a groupby operation + aggregation on the min/max values. df.groupby('id').agg(('min','max'))['date_column'] The output should be like this : different dataframe with each line cont …
Blenz's user avatar
  • 2,094
1 vote
Accepted

Similarity of XGBoost models?

No, they won't have neither the same performance nor the same architecture if you were to try to visualize it. An XGBoost with 100 n_estimators and a learning rate of 0.1 is a 100 trees grown sequenti …
Blenz's user avatar
  • 2,094
1 vote

The actual results and results from pickle files are not matching in pandas for DBSCAN clust...

Without looking at anything else : pred_val = pickle_model.fit_predict(test[['HD','MC_encoded']]) You're training your pickle_model on your test_data by using fit_predict() method. Start by replaci …
Blenz's user avatar
  • 2,094
0 votes
Accepted

find the difference between two columns in specific rows

for i in range (99,len(df),200): try: df1=df.loc[i+200,'acctimestamp'] - df.loc[i+200,'gyrtimestamp'] print(df1) except: print('End') Is what you're looking for? Step i …
Blenz's user avatar
  • 2,094