Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

dataframe

Pandas deleting row with df.drop doesn’t work

December 31, 2023 by Tarik

While dropping new DataFrame returns. If you want to apply changes to the current DataFrame you have to specify inplace parameter. Option 1 Assigning back to df – df = df.drop(790) Option 2 Inplace argument – df.drop(790, inplace=True)

Categories python Tags dataframe, pandas, python, python-3.x Leave a comment

Pandas: How to remove rows from a dataframe based on a list?

December 31, 2023 by Tarik

You need new_df = sales[~sales.CustomerID.isin(badcu)]

Categories python Tags dataframe, pandas, python Leave a comment

How to set the row names of a data frame passed on with the pipe %>% operator?

December 30, 2023 by Tarik
Categories r Tags dataframe, dplyr, magrittr, r Leave a comment

Count unique values for every column

December 30, 2023 by Tarik
Categories r Tags count, dataframe, r, unique Leave a comment

Get max value from row of a dataframe in python [duplicate]

December 30, 2023 by Tarik

Use max with axis=1: df = df.max(axis=1) print (df) 0 2.0 1 3.2 2 8.8 3 7.8 dtype: float64 And if need new column: df[‘max_value’] = df.max(axis=1) print (df) a b c max_value 0 1.2 2.0 0.10 2.0 1 2.1 1.1 3.20 3.2 2 0.2 1.9 8.80 8.8 3 3.3 7.8 0.12 7.8

Categories python Tags dataframe, max, pandas, python Leave a comment

Extract first word from a column and insert into new column [duplicate]

December 30, 2023 by Tarik
Categories r Tags dataframe, extract, r Leave a comment

How to Create Dataframe from AWS Athena using Boto3 get_query_results method

December 29, 2023 by Tarik
Categories python Tags amazon-athena, amazon-web-services, dataframe, pandas, python Leave a comment

PyCharm hanging for a long time in iPython console with big data

December 28, 2023 by Tarik

I have been facing the same issue for a long time as well: PyCharm debugging is extremely slow when using large pandas dataframes. If I want to view the contents of a dataframe in the Watches is often gives me a time out after waiting for minutes, so I basically stopped using the debug when … Read more

Categories pandas Tags dataframe, pandas, pycharm Leave a comment

KeyError: “None of [[”, ”]] are in the [columns]” pandas python

December 28, 2023 by Tarik

By the print you posted, it seems like you have whitespaces as delimiters. pd.read_csv will read using , as default separator, so you have to explicitly state it: pd.read_csv(‘source.txt’,header=0, delim_whitespace=True)

Categories python Tags dataframe, keyerror, pandas, python, slice Leave a comment

Is there an R dplyr method for merge with all=TRUE?

December 28, 2023 by Tarik
Categories r Tags dataframe, dplyr, r Leave a comment
Older posts
Newer posts
← Previous Page1 … Page5 Page6 Page7 … Page120 Next →

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa