Questions tagged [merging-data]

173 questions
-1
votes
1 answer

Merging several Pandas Dataframe objects

I have a list of Pandas DataFrame objects, df_list, which I have loaded from csv and parquet files and which have TimeStamp objects as indices. I want to merge all of them into one DataFrame object as follows: The indices for each DataFrame object…
HelloGoodbye
  • 3,624
  • 8
  • 42
  • 57
-1
votes
1 answer

Merging datasets in Python: 1st data set with city name and 2nd with two different columns for city_id for origin and destination cities to match with

I need some help in understanding merging 2 data sets in one in Python. Their layout is as follows, First has columns: city_id, city_name Second has: origincity_id, lat, long, destinationcity_id, lat, long I wanted to understand as to how I could…
-1
votes
1 answer

How to split year from date and make a new column; how to deal with leap years

I am very new to coding (this is the first code I am writing). I have multiple csv files, all with the same headers. The files correspond to hourly ozone concentration for every day of the year, and each file is a separate year [range from…
obscuredbyclouds
  • 189
  • 1
  • 1
  • 15
-1
votes
5 answers

Group/Merge rows from two 2d arrays based on 3 identifying columns and fill missing column values with null

I'm need to merge two 2d arrays by their time, size, and type values. This should created grouped data where value_one and value_two elements may exist in the same row. If there aren't two rows to merge together, then I need the missing element to…
-1
votes
7 answers

Merge data into an array then count the array values

I need to merge data into an array, then count the array values. $str = '"Cat","A","A","A","A"'; $abc = [ $str, "A", "Cat", "Dog", "A", "Dog" ]; print_r(array_count_values($abc)); Result came out: Array (…
Ashish
  • 7
  • 2
-1
votes
1 answer

Stata Merging data

I have cross-sectional data for a number of years. There's a unique identifier which denotes a specific person common in each cross-section. However, new people are added each year (and some people die and are therefore not in later years) I'd like…
Andrew01
  • 9
  • 1
-1
votes
1 answer

Merging 2 columns data horizontally?

I have this kind of data (2500 rows) | A | 111 | | A | 222 | | A | 333 | | B | 444 | | B | 555 | | B | 666 | | C | 777 | | C | 888 | | C | 999 | I would like it to merge like this, still keeping…
user883356
  • 33
  • 9
-3
votes
2 answers

Merge 3 Textfiles with python

Im really new to programming and couldn´t find a satisfying answer so far. Im using python and I want to merge three textfiles receive all possible word combinations. I have 3 files: First file: line1 line2 line3 Second…
1 2 3
11
12