Linked Questions

21 votes
1 answer
8k views

For a given data frame: UUT testa testb testc testd DateTime 2017-11-21 18:47:29 1.0 1.0 1.0 3.0 2017-11-21 18:47:30 1.0 2.0 1....
user97662's user avatar
  • 980
1 vote
1 answer
123 views

I would like to export certain data contained in nested dictionaries to a PD dataframe and then to Excel: counter=0 for m in [3]: for column, wind_speed in enumerate(wind_speeds): for row,ti in ...
user2500903's user avatar
1681 votes
43 answers
2.7m views

I have the following DataFrame (df): import numpy as np import pandas as pd df = pd.DataFrame(np.random.rand(10, 5)) I add more column(s) by assignment: df['mean'] = df.mean(1) How can I move the ...
Timmie's user avatar
  • 17k
479 votes
7 answers
584k views

I want to know if it is possible to use the pandas to_csv() function to add a dataframe to an existing csv file. The csv file has the same structure as the loaded data.
Ayoub Ennassiri's user avatar
18 votes
3 answers
50k views

I am trying to plot some data in pandas and the inbuilt plot function conveniently plots one line per column. What I want to do is to manually assign each line a color based on a classification I make....
GebitsGerbils's user avatar
9 votes
4 answers
11k views

I understand that there are magic methods in python that can be overwritten by classes to control the way certain built in functions treat the members of these classes. For example, the behavior of ...
gregrf's user avatar
  • 231
2 votes
3 answers
1k views

A B C D E 0 165349.20 136897.80 471784.10 New York 192261.83 1 162597.70 151377.59 443898.53 California 191792.06 2 ...
Zale Goldart's user avatar
4 votes
3 answers
685 views

I'm trying to sort the columns of a .csv file. These are the names and the order of the columns: 'Unnamed: 0', 'Unnamed: 1', '25Mg BLK', '25Mg 1', '25Mg 2', '44Ca BLK', '44Ca 1', '44Ca 2', '137Ba ...
qawert's user avatar
  • 91
2 votes
3 answers
874 views

I have a csv file 1 , name , 1012B-Amazon , 2044C-Flipcart , Bosh27-Walmart 2 , name , Kelvi20-Flipcart, LG-Walmart 3, name , Kenstar-Walmart, Sony-Amazon , Kenstar-Flipcart 4, name , LG18-...
Anoop D's user avatar
  • 1,890
1 vote
2 answers
545 views

I have columns with similar names but numeric suffixes that represent different occurrences of each column. For example, I have columns (company_1, job_title_1, location_1, company_2, job_title_2, ...
codr's user avatar
  • 61
0 votes
2 answers
1k views

I have 2 dataframes that both contain the same columns but are ordered differently. The first dataframe is ordered this way: Code Description Value 0 01 A .3 1 01 B ...
Jonathan Chen's user avatar
2 votes
1 answer
784 views

I tried reordering the column using sort_index, but it doesn't behave as I had hoped. After sorting, it reorders as below: >>> list(df) ['blocks_written_1', 'blocks_written_10', '...
aravindhan Selvan's user avatar
0 votes
0 answers
850 views

I want to copy the columns from an Excel file in a certain order, and then paste the columns I concatenated to the data frame df1 into another excel file at a certain interval. In other words, in ...
Yusuf's user avatar
  • 21
-1 votes
1 answer
642 views

I have a column called VERSION_INDEX which is Int64 and is a proxy for keeping a list of semantic software versions ordered such that 0.2.0 comes after 0.13.0. When I pivot, the column names created ...
rchitect-of-info's user avatar
0 votes
1 answer
388 views

I have following train dataframe kind of dataframe, train_df A B C D 6 8 7 3 7 9 1 8 11 7 2 3 and my test dataframe columns arrangement is as following, test_df C A D B ...
Nikhil Mangire's user avatar

15 30 50 per page