Showing posts with the label dataframe

[FIXED] pandas dataframe column contains string and int

Issue My data-frame age column looks like this 20 or younger =14 61 or older =45 56-60 …

[FIXED] Rename of huge number of columns - python / pandas

Issue I wonder how to change the names of columns which name has begin on "Unnamed:". Wan…

[FIXED] How would I generate API call via Python while reading data from csv flle? I am using Pandas library and would need some guidance

Issue I am still learning Data Engeineering and Data Science, new and appreciate any advice. Long …

[FIXED] How to convert pandas dataframe using Unstack?

Issue I want to convert the following DataFrame src="https://i.stack.imgur.com/CNttz.png"…

[FIXED] Pandas dataframe how to add a columns based on rank in a dates vector

Issue I have a vector of dates L = [Timestamp('2018-07-15 00:00:00'), Timestamp('201…

[FIXED] Find n consecutive business date where values are equal in Panadas data frames

Issue We need to return the list of dates for n consecutive business days ( Friday to Monday is 1 b…

[FIXED] JSON data parsing into pandas dataframe

Issue I have on specific issue that I cannot find a solution for, and I have looked at many of the …

[FIXED] How to get the most repated elements in a dataframe/array

Issue I compiled a list of the top artists for every year across 14 years and I want to gather the …

[FIXED] Find all duplicate values across two columns and make a single distinct row

Issue I have a df with two columns IP address and user id. I am attempting to determine the distinc…

[FIXED] Pandas: How do I create a new column given the column values exist in a list of lists?

Issue What's the neatest way to create a new column based on the values from another column bei…

[FIXED] JSON file parsing in Pyspark

Issue I am very new to Pyspark. I tried parsing the JSON file using the following code from pyspa…

[FIXED] How to check if array column is inside another column array in PySpark dataframe

Issue Suppose I have the following case from pyspark.sql.types import * schema = StructType([ # …

[FIXED] How to change column name of a dataframe with respect to other dataframe

Issue I have a requirement to change column name of a dataframe df with respect to other dataframe…

[FIXED] Remove blank space from data frame column values in Spark

Issue I have a data frame ( business_df ) of schema: |-- business_id: string (nullable = true) |--…

[FIXED] Join to dataframes based on index where the second dataframe has repeated indexes related to the first dataframe

Issue I have two data frames where first dataframe has index starting from zero. The second datafra…

[FIXED] Calculate mean of column for each row excluding the row for which mean is calculated

Issue I need to calculate the mean of a certain column in DataFrame, so that means for each row is …

[FIXED] The simplest way to convert a list with various length vectors to a data.frame in R

Issue Here I have a list with different length vectors. And I'd want to get a data.frame. I'…

[FIXED] Pandas select rows based on randomly selected group from a specific column

Issue I have a dataframe > df = C1. C2. C3 > a. 1. 2 > a. 3. 5 > …

[FIXED] Pandas: I want slice the data and shuffle them to genereate some synthetic data

Issue Just want to help with data science to generate some synthetic data since we don't have e…

[FIXED] How to combine column in dataframe based on date&time and take the mean of the value

Issue I would like to ask how can I join the dataframe as shown in (exiting dataframe) to group val…