Category "dataframe"

Adding a new column in pandas dataframe from another dataframe with differing indices

This is my original dataframe. This is my second dataframe containing one column. I want to add the column of second dataframe to the original dataframe at th

How to convert a nested dict, to a pandas dataframe

I'm trying to convert a dataframe that has inside other dataframe like: { 'id': 3241234, 'data': { 'name':'carol', 'lastname': 'netfli

Efficient way to unnest (explode) multiple list columns in a pandas DataFrame

I am reading multiple JSON objects into one DataFrame. The problem is that some of the columns are lists. Also, the data is very big and because of that I canno

Pandas wide to long bringing empty DataFrame

I was working in a pretty simple task: applying wide_to_long to a DataFrame, but every time I ran it, I got an empty DataFrame. I was almost sure I was doing it

Skipping same entries in different rows of a column in SQL table

for example I have created a dataframe in R named as "Numbers" which has following output: Numbers 1 2 3 2 4 1 When I tried to insert this dataframe in SQL tab

Merging two dataframes without losing data

I have two dataframes: df_1 = Material TypeOf 4100 N200 4101 M200 4200 M200 4500 N200 .

retrieve only months with at least 28 sample days - pandas dataframe

Hello to the people of the web, I have a dataframe containing 'DATE' (datetime) as index and TMAX as column with values: tmax dataframe What i'm trying to do is

Py4JJavaError when trying to write pyspark DataFrame to parquet

I wanted to convert a large .csv vile into .parquet format using pyspark. I am using python 3. I tried changing the codec used for compression, as suggested in

randomly split dataframe into groups with even distribution of values

I have a dataframe of two groups (A and B) and within those groups, 6 subgroups (a, b, c, d, e, and f). Example data below: index group subgroup value 0

How do I reorder a long string of concatenated date and timestamps seperated by commas using Python?

I have a string type column called 'datetimes' that contains multiple dates with their timestamps, and I'm trying to extract the earliest and last dates (withou

How do I reorder a long string of concatenated date and timestamps seperated by commas using Python?

I have a string type column called 'datetimes' that contains multiple dates with their timestamps, and I'm trying to extract the earliest and last dates (withou

How to create variables based on column names in dataframe?

I wanted to create variables in python based on the column names of my dataframe. Not sure if this is possible as I am quite new to Python. Lets say my df looks

How to create variables based on column names in dataframe?

I wanted to create variables in python based on the column names of my dataframe. Not sure if this is possible as I am quite new to Python. Lets say my df looks

AttributeError: Can't get attribute '_unpickle_block'

While using: with open("data_file.pickle", "rb") as pfile: raw_data = pickle.load(pfile) I get the error: AttributeError: Can't get attribute '_unpickle

Change order of categorical bars in Plotly parallel categories

I am trying to visualize changes in gene expression as categorical variables (up, down, no change) over various timepoints. I have a dataframe describing differ

Python: pandas merge multiple dataframes

I have diferent dataframes and need to merge them together based on the date column. If I only had two dataframes, I could use df1.merge(df2, on='date'), to do

how to remove milliseconds or decimals in a specific dataframe column

I have 2 columns containing date and time(hr,min,seconds:milliseconds) How do I remove the milliseconds from only one of the column? Name MinTime

Changing values in columns based on their previous marker

I have the following dataframe: df = {'id': [1,2,3,4], '1': ['Green', 'Green', 'Green', 'Green'], '2': ['34','67', 'Blue', '77'], '3': ['Blue', '45', '9

Removing NAs from two columns in data frame a shift up

I have this data frame atac.v1.pbmc.5k.possorted.bam.bam possorted.bam.bam chr1.9941.10736 NA

Converting column values to rows [duplicate]

I have a dataset where all values in column B are the same. It looks like this: A B 0 Marble Hill Pizza Place 1 Ch