python write list to csv single columndixie d'amelio film
import pandas as pd df = pd.read_csv('1.csv') ## 1.csv is the csv file I want to import. Also sorry that I want to mention a previous question too. Check out my profile. import csv with open ('names.csv', 'w') as csvfile: fieldnames = ['var1', 'var2'] writer = csv.DictWriter (csvfile, fieldnames=fieldnames) writer.writeheader () writer.writerow ( {'var1': var1, 'var2': var2}) This will write the values of var1 and var2 to separate columns named var1 and var2. EG: You need to decide what columns you want to write out. Please. Names.csv. Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. And the code I use to write to the csv is: You should change the delimiter. I have two lists that both contain values that I want to write into a csv file. WebAnd the code I use to write to the csv is: import csv resultFile = open ("/filepath",'wb') wr = csv.writer (resultFile) wr.writerows ( [testLabels]) Any help would be greatly appreciated. Amazing answer and easy to understand. csvfile = "summary.csv" with open (csvfile, "w") as output: writer = csv.writer (output, lineterminator='\n') for f in sys.argv [1:]: words = re.findall ('\w+', open ('f').read ().lower ()) cnt1, cnt2 = 0, 0 cntWords = len (words) for word in words: if word in wanted1: cnt1 += 1 if word in wanted2: cnt2 += 1 print cnt1, cnt2, cntWords res = Improve this answer. WebThe way to select specific columns is this - header = ["InviteTime (Oracle)", "Orig Number", "Orig IP Address", "Dest Number"] df.to_csv ('output.csv', columns = header) Share Improve this answer Follow edited Apr 25, 2015 at 13:05 Nikita Pestrov 5,846 4 30 66 answered Feb 25, 2014 at 16:11 user1827356 6,694 2 21 30 3 How to save certain columns from csv file as variables in Python? Actual answers are taken from here and here. I then append this Tuple of Alphabetic e-mails to a List containing exactly one item (i.e. Why don't objects get brighter when I reflect their light back at them? How to read data from a specific column in python? I'm just aggregating what other's have said in a simple manner. We can see the nested list as the output in the below screenshot. Why do people write "#!/usr/bin/env python" on the first line of a Python script? What are possible reasons a sound may be continually clicking (low amplitude, no sudden changes in amplitude). This should provide you with an output of all your list elements in a single column rather than a single row. Real polynomials that go to infinity in all directions: how fast do they grow? Can we create two different filesystems on a single partition? The data already includes commas and numbers in English along with Arabic text. What does Canada immigration officer mean by "I'm not satisfied that you will leave Canada based on your purpose of visit"? New Home Construction Electrical Schematic. This is another solution. Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide, ISTM a CSV file with only column doesn't need a csv.writer. Is it considered impolite to mention seeing a new city as an incentive for conference attendance? After thinkering for a while i was able to come up with an easier way of achieving same goal. Content Discovery initiative 4/13 update: Related questions using a Machine Python CSV output two rows instead of two column, Write list to csv with new column in for-loop, Writing multiple sets of lists into a csv file, Save output in a new column of input file python3, Move pointer to other column to write CSV in python. What is the etymology of the term space-time? But when I open the file in excel, the data is shown in one row. What are possible reasons a sound may be continually clicking (low amplitude, no sudden changes in amplitude). What to do during Summer? Share Follow answered Jul 4, 2018 at 7:29 Vishal Ghorpade 137 11 Add a comment Your Answer Post Your Answer AFAIK, the only people who still use the csv module are those who have not yet discovered better tools for working with tabular data (pandas, petl, etc. What PHILOSOPHERS understand for intelligence? There's a wonderful resource Pymotw(Python module of the week) that explains the usage of a lot of modules. Stack Overflow is about learning, not providing snippets to blindly copy and paste. The csv module isn't necessary in this case. This is most likely the end of your code: Now that we have covered your mistake, I would like to take this time to introduce you to the pandas module. Extending @CalebJ's answer, shorter version could be like this: Thanks for contributing an answer to Stack Overflow! How to read a file line-by-line into a list? By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. However, a part of the data from column B is written to column A. Straight to the point and got me going. This is quite simple if your goal is just to write the output column by column. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Your contribution would be more meaningful if you would include some explanation about why this approach should work and be an improvement over what has already been proposed and accepted as the answer. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. writerow accepts a sequence. How to create a filter input function with Python? How can I make inferences about individuals from aggregated data? Is a copyright claim diminished by an owner's refusal to publish? By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. First create a dataframe as per the your needs for storing in csv. Can I ask for a refund or credit next year? Spellcaster Dragons Casting with legendary actions? I can't figure out how to write my output of my program to a CSV file in columns. Thanks. Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. How can I drop 15 V down to 3.7 V to drive a motor? Alternate solution: Assuming daily_returns is the name of the list you wish to write as a column in a CSV file, the following code should work: with open ('return.csv','w') as f: writer = csv.writer (f) writer.writerows (zip (daily_returns)) This was the only solution that worked for me in Python 3.x. As you've mentioned, you want var1 and var2 written to separate columns. WebUsing pandas dataframe,we can write to csv. If you need to process the columns separately, I like to destructure the columns with the zip(*iterable) pattern (effectively "unzip"). How to check if an SSM2220 IC is authentic and not fake? What is the difference between these 2 index setups? Asking for help, clarification, or responding to other answers. rev2023.4.17.43393. (Python3.5), Iterating each character in a string using Python. This is honestly amazing and should get more votes imo. Webwith open ("out.txt", 'w') as outfile: for k,v in dict1.items (): outfile.write (str (k)) for item in v: outfile.write (","+str (item)) outfile.write (" ") Just in general never try to hand-write a CSV file like this, as it won't handle escaping at all properly, among other things. How can I output MySQL query results in CSV format? This was the only solution that worked for me in Python 3.x. What should I do when an employer issues a check and requests my personal banking access details? Did Jesus have in mind the tradition of preserving of leavening agent, while speaking of the Pharisees' Yeast? Please note that the original csv file already has a few columns existed. How can I filter keywords from a csv file using Python, ValueError, how to take column of strings from another document into my program, Extract 2 lists out of csv file in python, Python; extract rows from csv if particular column is filled. so that the writing to CSV file does not separate each e-mail string into multiple columns as discovered in testing). Why does your example CSV file show the pipe character as the delimiter but your example code use a space? import csv from itertools import zip_longest d = [ [2,3,4,8], [5,6]] with open ("file.csv","w+") as f: writer = csv.writer (f) for values in zip_longest (*d): writer.writerow (values) There's no 'neat' way to write it since, as you said, zip truncates to the length of the shortest iterable. what about Result_* there also are generated in the loop (because i don't think it's possible to add to the csv file). Content Discovery initiative 4/13 update: Related questions using a Machine How to concatenate text from multiple rows into a single text string in SQL Server. Trying to determine if there is a calculation for AC in DND5E that incorporates different material items worn at the same time. How do I merge two dictionaries in a single expression in Python? if you have 1000s of columns, you might run into the unix file handle limit! By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. Improve this answer. How do I return dictionary keys as a list in Python? Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide, @Elazar: in Python 2 (which the OP is using). Is "in fear for one's life" an idiom with limited variations or can you add another noun phrase to it? Hi. In case you don't really have a memory problem, you can still use this method; I've put in comments to indicate the changes needed if you want to use a list. import pandas as pd df = pd.read_csv('1.csv') ## 1.csv is the csv file I want to import. In what context did Garak (ST:DS9) speak of a lie between two truths? By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Thanks. rev2023.4.17.43393. How do I get the number of elements in a list (length of a list) in Python? So you have to add the option delimiter=";", like. How can I make the following table quickly? I used 'w' instead of 'wb'. One last issue is that I also have some blank column in my csv file. Find centralized, trusted content and collaborate around the technologies you use most. How is the 'right to healthcare' reconciled with the freedom of medical staff to choose where and when they work? It gave me an error " tolist() takes 1 positional argument but 2 were given" when I typed 'unnamed' to the parenthesis? Can someone please tell me what is written on this score? I want to have one column where each member of the array is a row. I do want to get rid of those indices but I want to keep just one left. To learn more, see our tips on writing great answers. 1. What does Canada immigration officer mean by "I'm not satisfied that you will leave Canada based on your purpose of visit"? Real polynomials that go to infinity in all directions: how fast do they grow? Here's the one for the CSV module: How do I write my output to a CSV in multiple columns in Python, The philosopher who believes in Web Assembly, Improving the copy in the close modal and post notices - 2023 edition, New blog post from our CEO Prashanth: Community is the future of AI. I didn't realize I needed the brackets. You could replace, I need it to be on a Excel worksheet, one row 5 columns and what i always got is one row one column, I'm not sure how your excel is configured, but you could try. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. but it only writes to a file, not specify which column its in. In that way the NAN values will be left blank. Connect and share knowledge within a single location that is structured and easy to search. How to provision multi-tier a file system across fast and slow storage while combining capacity? Content Discovery initiative 4/13 update: Related questions using a Machine Why does writing a list of words to a CSV file write the individual characters instead? import csv from itertools import zip_longest d = [ [2,3,4,8], [5,6]] with open ("file.csv","w+") as f: writer = csv.writer (f) for values in zip_longest (*d): writer.writerow (values) There's no 'neat' way to write it since, as you said, zip truncates to the length of the shortest iterable. Making statements based on opinion; back them up with references or personal experience. the key has many values. Share. Can a rotating object accelerate by changing shape? I'm looking for a way to write a python dictionary to columns (keys in first column and values in second). Spellcaster Dragons Casting with legendary actions? python2 sc-123.py > scalable_decoding_time.csv. Why is a "TeX point" slightly larger than an "American point"? Thanks to the way you can index and subset a pandas dataframe, a very easy way to extract a single column from a csv file into a variable is: myVar = pd.read_csv ('YourPath', sep = ",") ['ColumnName'] A few things to consider: The snippet above will produce a pandas Series and not dataframe . If your item is a list: yourList = [] with open ('yourNewFileName.csv', 'w', ) as myfile: wr = csv.writer (myfile, quoting=csv.QUOTE_ALL) for word in yourList: wr.writerow ( [word]) Share Improve this answer Follow edited Jul 13, 2018 at 12:13 m00am 5,732 11 55 67 Peanut butter and Jelly sandwich - adapted to ingredients from the UK. Code I've looked at has led me to believe I can call the specific column by its corresponding number, so ie: Name would correspond to 2 and iterating through each row using row[2] would produce all the items in column 2. This is another solution. Not the answer you're looking for? Assuming you have the code as below: zip will only take number of elements equal to the shortest length list. Does Chain Lightning deal damage to its original target first? Does contemporary usage of "neithernor" for more than two options originate in the US. On a 32-bit Python, storing a float in a list takes 16 bytes for the float object and 4 bytes for a pointer in the list; total 20. Please note that the original csv file already has a few columns existed. This link shows how to write a list to a column, but am wondering if there is a way to do this without converting my dictionary to two zipped lists. What is the difference between these 2 index setups? How do I concatenate two lists in Python? Content Discovery initiative 4/13 update: Related questions using a Machine How can I make a dictionary (dict) from separate lists of keys and values? Of course I'm missing something. You can use the string join method to insert a comma between all the elements of your list. How can I detect when a signal becomes noisy? Can someone please tell me what is written on this score? If so, make it a list of one item: (By the way, the unicode() call is completely unnecessary since you're already joining with a unicode delimiter.). Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. Hi. Webimport csv with open ("output.csv", 'w', newline= '') as output: wr = csv.writer (output, dialect='excel') for element in list_of_things: wr.writerow ( [element]) output.close () This should provide you with an output of all your list elements in a This is another solution. In this Python tutorial, we will learn the Python write list to CSV, and also we will cover these topics: Here, we can see write a list to csv in python. Asking for help, clarification, or responding to other answers. Spellcaster Dragons Casting with legendary actions? Save PL/pgSQL output from PostgreSQL to a CSV file. If a people can travel space via artificial wormholes, would that necessitate the existence of time travel? Making statements based on opinion; back them up with references or personal experience. Does Chain Lightning deal damage to its original target first? This will eliminate the need for newline. Does Chain Lightning deal damage to its original target first? How do I merge two dictionaries in a single expression in Python? In what context did Garak (ST:DS9) speak of a lie between two truths? Then create csv of the dataframe using pd.DataFrame.to_csv () API. Both steps should handle steaming just fine. Then write the resulting string to file. import csv from itertools import zip_longest d = [ [2,3,4,8], [5,6]] with open ("file.csv","w+") as f: writer = csv.writer (f) for values in zip_longest (*d): writer.writerow (values) There's no 'neat' way to write it since, as you said, zip truncates to the length of the shortest iterable. Why does Paul interchange the armour in Ephesians 6 and 1 Thessalonians 5? Withdrawing a paper after acceptance modulo revisions? CSV file written with Python has blank lines between each row, UnicodeDecodeError when reading CSV file in Pandas, Deleting DataFrame row in Pandas based on column value, Import multiple CSV files into pandas and concatenate into one DataFrame. (NOT interested in AI answers, please). So in here iloc[:, 0], : means all values, 0 means the position of the column. What information do I need to ensure I kill the same process, not one spawned much later with the same PID? If for some reason your print statement was in for loop and it was still only printing out the last column, which shouldn't happen, but let me know if my assumption was wrong. Code is a lot more helpful when it is accompanied by an explanation. You can tweak the exact format of the output CSV via the various optional parameters to csv.writer () as documented in the library reference page linked above. I then append this Tuple of Alphabetic e-mails to a List containing exactly one item (i.e. Making statements based on opinion; back them up with references or personal experience. Withdrawing a paper after acceptance modulo revisions? python list csv Share Improve this question Follow Asking for help, clarification, or responding to other answers. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Can someone please tell me what is written on this score? Asking for help, clarification, or responding to other answers. Anyone know a good way to get five separate columns? Mike Sipser and Wikipedia seem to disagree on Chomsky's normal form. Python TypeError: list object is not callable, Check if a list exists in another list Python, Python Tkinter ToDo List (Build Step by Step), How to Split a String Using Regex in Python, How to Split a String into an Array in Python. csvfile = "summary.csv" with open (csvfile, "w") as output: writer = csv.writer (output, lineterminator='\n') for f in sys.argv [1:]: words = re.findall ('\w+', open ('f').read ().lower ()) cnt1, cnt2 = 0, 0 cntWords = len (words) for word in words: if word in wanted1: cnt1 += 1 if word in wanted2: cnt2 += 1 print cnt1, cnt2, cntWords res = In the below screenshot you can see the output: Here, we can see how to append a list to an already existing csv file in python. How can I make the following table quickly? That would make the lists seriously big. import csv with open ('names.csv', 'w') as csvfile: fieldnames = ['var1', 'var2'] writer = csv.DictWriter (csvfile, fieldnames=fieldnames) writer.writeheader () writer.writerow ( {'var1': var1, 'var2': var2}) This will write the values of var1 and var2 to separate columns named var1 and var2. To learn more, see our tips on writing great answers. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. How to intersect two lines that are not touching, Trying to determine if there is a calculation for AC in DND5E that incorporates different material items worn at the same time. For python 3.X, change the for loop line to for row in myDict.items(): To get the ; separator, pass delimiter to csv.reader or csv.writer. I need this list to be written to a csv file on one row(1) and each element from A to E. Ive tried almost everything and it always write on on column or just in on cell(A1) Thanks!! The problem is the while loop can last over 100,000 loops or more. How do I get the number of elements in a list (length of a list) in Python? In this case: Thanks for contributing an answer to Stack Overflow! How many columns in the output file? And how to capitalize on that? I need to write this data to a CSV file, so it writes by column rather than row. rev2023.4.17.43393. What does the "yield" keyword do in Python? Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. You're giving it a single string, so it's treating that as a sequence, and strings act like sequences of characters. import pandas as pd df = pd.read_csv('1.csv') ## 1.csv is the csv file I want to import. rev2023.4.17.43393. You can refer to the below screenshot for the output. python arrays excel csv machine-learning Share Improve this question Follow asked Jan 30, 2014 at 19:12 user3240210 143 1 2 6 python2 sc-123.py > scalable_decoding_time.csv. Updating lines in place in a file is not supported on most file system (a line in a file is just some data that ends with newline, the next line start just after that). By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. How can I test if a new package version will pass the metadata verification step without triggering a new package version? How to append a new row to an old CSV file in Python? The list can be seen as the output, you can refer to the below screenshot for thr output: Now, we can see how to write a list to csv with newline in python, Now, we can see how write nested list to csv in python. We can see the output in the row format. Then write the resulting string to file. use python or unix paste command to rejoin on tab, csv, whatever. Use Raster Layer as a Mask over a polygon in QGIS. Should the alternative hypothesis always be the research hypothesis? To learn more, see our tips on writing great answers. The writing to csv file and should get more votes imo screenshot for the output column by.. One last issue is that I want to write my output of my program to a list ( length a. Exactly one item ( i.e not fake write my output of all your list elements in a single in... Want var1 and var2 written to column a an `` American point '' larger! A new package version will pass the metadata verification step without triggering a new version... N'T objects get brighter when I open the file in columns on tab, csv whatever... For the output travel space via artificial wormholes, would that necessitate the existence of time travel in! Reasons a sound may be continually clicking ( low amplitude, no sudden changes in amplitude ) spawned. Knowledge with coworkers, Reach developers & technologists worldwide healthcare ' reconciled the... How can I make inferences about individuals from aggregated data back at them you 're giving it single! One spawned much later with the freedom of medical staff to choose Where and when work... This score do they grow, shorter version could be like this: Thanks for an. Snippets to blindly copy and paste of a list containing exactly one item ( i.e point '' filter input with... So it 's treating that as a sequence, and strings act like sequences of characters read data from B! Pymotw ( Python module of the array is a calculation for AC DND5E. ) # # 1.csv is the difference between these 2 index setups but I want import! While loop can last over 100,000 loops or more authentic and not fake ( ' 1.csv )... Objects get brighter when I open the file in columns structured and easy to search one life. Check and requests my personal banking access details not interested in AI answers, please ) how do I to. How do I merge two dictionaries in a list in Python 3.x you should python write list to csv single column. Like sequences of characters written to separate columns not specify which column its in me is! The week ) that explains the usage of a list in Python site design / logo 2023 Stack Exchange ;. Is honestly amazing and should get more votes imo nested python write list to csv single column as the but... An explanation 2 index setups loop can last over 100,000 loops or.. To disagree on Chomsky 's normal form to an old csv file show the pipe character as the column... On your purpose of visit '' snippets to blindly copy and paste knowledge within single. Two lists that both contain values that I want to import people can space! ( length of a Python script treating that as a Mask over a in... ( keys in first column and values in second ) each character in list. N'T figure out how to write into a csv file already has a few existed. Shown in one row leave Canada based on your purpose of visit '' means all values 0! Delimiter but your example csv file already has a few columns existed resource Pymotw ( Python of. I return dictionary keys as a list snippets to blindly copy and paste know a good way to get of.,: means all values, 0 ],: means all values 0! To an old csv file in excel, the data from column B written. Might run into the unix file handle limit or responding to other answers ) that explains the usage ``... Calculation for AC in DND5E that incorporates different material items worn at the same PID, see our on! Individuals from aggregated data in the US is n't necessary in this case: for! You agree to our terms of service, privacy policy and cookie policy statements based your! Same PID slightly larger than an `` American point '' individuals from aggregated data get! Each character in a single column rather than row changes in amplitude.! Shortest length list, shorter version could be like this: Thanks for contributing an Answer to Stack Overflow based. Number of elements in a single location that is structured and easy to search of preserving of leavening agent while. Terms of service, privacy policy and cookie policy, would that necessitate the existence of time?. Pharisees ' Yeast the column one item ( i.e between all the elements of your elements..., and strings act like sequences of characters ( ) API have the code as below: will! An owner 's refusal to publish both contain values that I want to.! A single partition and when they work single row hypothesis always be python write list to csv single column research hypothesis verification. Be continually clicking ( low amplitude, no sudden changes in amplitude ) get rid of those indices but want... Find centralized, trusted content and collaborate around the technologies you use.. Write out a string using Python column rather than row is `` in fear for one 's life '' idiom. Technologists worldwide just aggregating what other 's have said in a single string, it... Here iloc [:, 0 means the position of the Pharisees Yeast! Five separate columns the existence of time travel each character in a simple manner I detect when signal! Data is shown in one row paste command to rejoin on tab, csv whatever! 'M looking for a refund or credit next year Reach developers & technologists worldwide option delimiter= '' ; '' like. Used ' w ' instead of 'wb ' next year ) API or more one issue! Add another noun phrase to it what does the `` yield '' do. Of characters wormholes, would that necessitate the existence of time travel requests my personal banking access details ;... But it only writes to a csv file already has a few columns existed elements... A `` TeX point '' was able to come up with references or personal experience to. Ac in DND5E that incorporates different material items worn at the same process, not specify column! Separate each e-mail string into multiple columns as discovered in testing ) ( ) API DND5E! The first line of a lie between two truths variations or can you add another noun to! Is the difference between these 2 index setups ' ) # # 1.csv is the csv file want... Giving it a single column rather than row keyword do in Python the alternative hypothesis always the! Speak of a Python script each character in a list in Python fear for one 's life '' idiom! The row format will pass the metadata verification step without triggering a new package version csv format comma all... To blindly copy and paste information do I merge two dictionaries in a single expression in Python a... Answer, you might run into the unix file handle limit Alphabetic e-mails to a list ) in 3.x! American point '' not fake a single expression in Python of 'wb ' AI answers please. Option delimiter= '' ; '', like index setups 3.7 V to drive a motor do people ``... Keys in first column and values in second ) written on this score looking for way... Looking for a way to write my output of all your list elements in list! Postgresql to a file system across fast and slow storage while combining capacity: 0... A polygon in QGIS metadata verification step without triggering a new city as an incentive for conference attendance text! Change the delimiter Pharisees ' Yeast the research hypothesis people write `` #! /usr/bin/env Python '' on the line! ) # # 1.csv is the 'right to healthcare ' reconciled with freedom! Handle limit lists that both contain values that I want to keep just one.. Question Follow asking for help, clarification, or responding to other.... Another noun phrase to it in fear for one 's life '' an idiom with limited variations can... The elements of your list to healthcare ' reconciled with the same process, not one much! More than two options originate in the row format to determine if there is a calculation for in... By `` I 'm not satisfied that you will leave Canada based on opinion back... Visit '' Stack Exchange Inc ; user contributions licensed under CC BY-SA a calculation for AC DND5E! Variations or can you add another noun phrase to it to provision multi-tier file... You can use the string join method to insert a comma between the... Share knowledge within a single row loop can last over 100,000 loops or more spawned... Note that the original csv file in excel, the python write list to csv single column already includes commas and numbers in along. In the below screenshot of visit '' was able to come up with references or experience! Licensed under CC BY-SA screenshot for the output you have 1000s of,. Var2 written to column a they grow Ephesians 6 and 1 Thessalonians 5 append this Tuple of Alphabetic to... Private knowledge with coworkers, Reach developers & technologists share private knowledge with,. On opinion ; back them up with an output of all your list I also have some blank in... On tab, csv, whatever the 'right to healthcare ' reconciled with the same,. Want to import this data to a list containing exactly one item ( i.e we can see nested. Answers, please ) is a `` TeX point '' possible reasons a sound may be continually clicking low... Time travel does Chain Lightning deal damage to its original target first research! Amplitude, no sudden changes in amplitude ) have 1000s of columns, you agree to our of! With Arabic text Overflow is about learning, not one spawned much later with the same PID a input...