I've been off the "panda" for a few months but I've had a relapse...
This is my short little script:
import pandas as pd
user_input = pd.read_csv(raw_input("Enter file-path: "),sep=r'\s+')
get_Info =user_input[user_input['Monid'].str.contains(raw_input("Enter a star: "))]
for value in get_Info.values:
print value
My intent is to print the values of get_Info.values
into a string rather than the array that pandas prints them out as, like so:
[Mon-000005 99.999 19.67 18.242 17.134 15.722 99.999 99.999 99.999 99.999
14.254 0.044 13.532 0.043 13.33 0.042 13.154 0.007 13.106 0.008 12.968
0.04 12.985 0.115 99.999 99.999 M3 6.56 1 N]
I can remove those brackets with a str.replace
after converting the output via a str()
defining, but that doesn't seem too efficient. Even after doing that it still has the line breaks as seen above. I'd like to just print it out as one string, not three separate lines. I'm not sure how to do that, and why is it breaking the lines in the first place?
Thanks.